Suggestion Can BBCode translation be disabled inside a code block?

  • Thread starter Thread starter PeterDonis
  • Start date Start date
AI Thread 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,023
Reaction score
25,105
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.
 

Similar threads

Back
Top