Suggestion Can BBCode translation be disabled inside a code block?

  • Thread starter Thread starter PeterDonis
  • Start date Start date
Click For Summary
BBCode translation can inadvertently alter code posted in forums, as demonstrated by a member's Python code that changed due to BBCode processing. Specifically, an array reference using [i] was converted to [I], which is recognized as an italics tag. The discussion centers on whether BBCode translation can be disabled within code blocks to prevent such issues. While some users believe BBCode is ignored in code blocks, others have experienced problems when editing posts. The thread highlights the need for clarity on how BBCode interacts with code formatting in forum posts.
Messages
49,421
Reaction score
25,470
In a recent thread in the computer forum, a member posted Python code that was inadvertently changed by something in the posting process. @Mark44 suggested that it could be BBCode translation (a lower case i inside brackets, [i], which was an array reference in the code, got changed to an upper case I, and [I] is BBcode for starting an italics block). The Python code was inside a [CODE] block; would it be possible to disable BBCode translation inside code blocks?

@Mark44's post in the thread in question is here:

https://www.physicsforums.com/threads/python-code-returning-none.1012334/post-6599954
 
Physics news on Phys.org
[CODE title="testing"]

[/CODE]

I was always under impression BBCode IS ignored in the code blocks and - at least when I post from my computer - that seems to be the case.

Could be it gets processed when the post is edited or dealt with in some specific way.
 
I've seen this happen where a bracketed i gets treated as a BBCode italics start tag. I can't reproduce this now for some reason.
 
Hello everyone, I recently revisited Physics Forums after a long hiatus (about 4-5 years) and started catching up on the recent discussions. What immediately struck me—and what inspired this thread—is seeing so many of the exact same user names in the "Latest Posts" section who were just as active when I was last here! To the dedicated, long-term, and continuously active members of this community: What keeps you coming back and contributing regularly after all this time? Is it the joy...

Similar threads

  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 21 ·
Replies
21
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 26 ·
Replies
26
Views
3K
  • · Replies 183 ·
7
Replies
183
Views
80K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K