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
48,835
Reaction score
24,959
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.
 
I want to thank those members who interacted with me a couple of years ago in two Optics Forum threads. They were @Drakkith, @hutchphd, @Gleb1964, and @KAHR-Alpha. I had something I wanted the scientific community to know and slipped a new idea in against the rules. Thank you also to @berkeman for suggesting paths to meet with academia. Anyway, I finally got a paper on the same matter as discussed in those forum threads, the fat lens model, got it peer-reviewed, and IJRAP...
This came up in my job today (UXP). Never thought to raise it here on PF till now. Hyperlinks really should be underlined at all times. PF only underlines them when they are rolled over. Colour alone (especially dark blue/purple) makes it difficult to spot a hyperlink in a large block of text (or even a small one). Not everyone can see perfectly. Even if they don't suffer from colour deficiency, not everyone has the visual acuity to distinguish two very close shades of text. Hover actions...
About 20 years ago, in my mid-30s (and with a BA in economics and a master's in business), I started taking night classes in physics hoping to eventually earn the science degree I'd always wanted but never pursued. I found physics forums and used it to ask questions I was unable to get answered from my textbooks or class lectures. Unfortunately, work and life got in the way and I never got further the freshman courses. Well, here it is 20 years later. I'm in my mid-50s now, and in a...

Similar threads

Back
Top