BBCode Update 2025

Announcements, comments, ideas, feedback, and "How do I... ?" questions
User avatar
euler
Administrator
Posts: 5094
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

BBCode Update 2025

Post by euler »

Over the years the BBCode module used in the problem threads has continued to be modified and have additional tags added. So, to ensure a more streamlined performance, the entire module has been rewritten. Every attempt has been made to support both recent and legacy posts and I have tried my best to check the rendering is accurate on multiple posts. But it is quite possible that I might have missed something. If you have identified an issue, please report it here.

I have added a few new tags and tidied up the way some of the existing tags are used. Check out About... Forum Tags for more information.

In addition, these changes have had a knock-on effect with how the syntax highlighter operates. So if you spot something not quite right, please report it here too. As a small bonus, it is now possible to switch the syntax highlighting stylesheet from your Account page. The default, and the one we have been using for many years, is Stack Overflow, but you can also use GitHub and Google now, which all support light (default) and dark mode.
Image
impudens simia et macrologus profundus fabulae
philiplu
Posts: 92
Joined: Wed Aug 02, 2017 8:51 pm
Location: Redmond, WA, USA

Re: BBCode Update 2025

Post by philiplu »

Seems to be some bleed-through of formatting affects from one post to another. Take a look at the problem 478 forum. MuthuVeerappanR's post of 22 May 2015 has some weird formatting towards the end of the post, and every post after that has the normal post style features missing or misaligned (no shading over the post, post header not right-aligned).

I'm seeing that both on an iPad/Safari, and Edge on Windows 11.
Image
User avatar
euler
Administrator
Posts: 5094
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: BBCode Update 2025

Post by euler »

Great find. Thanks for reporting it. That was a more complicated fix than I'd hoped for as it's required me to change the way that MathJax is handled on the page. It should be viewing correctly now.
Image
impudens simia et macrologus profundus fabulae
hacatu
Posts: 45
Joined: Tue Dec 08, 2020 9:06 pm

Re: BBCode Update 2025

Post by hacatu »

The new list tags are great, and the new example for the image tag is a lot easier to spot than the old one which was an image of text.

I'm reformatting some of my old posts with the new tags and I found a few issues:
  • `list=I` overflows the left margin for `III`, and probably any list-label with 3+ characters in general overflows
  • `list=4` or similar cannot be used to start an indexed list after `1` or `a` or etc, which might be useful if you want to put a long comment in the middle of the list
  • `code` inside `collapse` is still messed up
EDIT: Also, some mathjax in collapse titles messes up the left margin within the collapse. This does not always happen, but for example in my post on 935 the text inside the collapse has its left margin aligned to the right edge of the title text

And looking at posts like Kunero's in the same thread, it might be useful to have some option on images to make them fit to width
Image
User avatar
euler
Administrator
Posts: 5094
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: BBCode Update 2025

Post by euler »

Thanks for reporting the issues.

The problem with the left margin issue is almost certainly only going to happen with Roman numerals. There are two solutions: A) Only allow type=1, type=a, type=A, or, B) Use CSS to target type=i (or I) to increase the size of the margin for those ordered lists.

But a lot of that would depend on how I handle the second issue. Generally, I've tried to keep things as simple as possible and to follow the standards in BBCode that have been used for many years elsewhere. Allowing lists to start at different positions is a novel idea. So there are three options:
  1. list={type}-{start}; for example, list=1-5, would have 5, 6, 7, ... or list=a-5, would have e, f, g, ...
  2. list=5 would have 5, 6, 7, ... or list=e would have e, f, g, ...
  3. Lists cannot have starting positions set.
Obviously method 1 could be combined with fix B) above and allow something like list=i-5, but I'm not happy with the idea that Roman numerals can get long depending on starting position. Plus, Roman numerals do not tend to be part of standard BBCode.

One of the best compromises would be to go to A2, in that it's intuitive to use and numeric or lettered lists should be sufficient. However, even though I like the idea it is not standard BBCode. So I'm currently not sure how to proceed. I'll happily take feedback and think about it.

Regarding the issue of code not working within collapsible sections, I'm guessing you mean nested content doesn't expand properly? If so, a not so perfect workaround is to expand the nested content, then close the main content and reopen it. That has always been an issue and I've never found a proper solution, but I didn't spend much time on it because I couldn't imagine why anyone would want to place code (which collapses itself) inside collapsible content. Or is there another issue you have noticed? If so, could you point me to an example post or provide some simple BBCode here that would simulate the problem?

[edit]Responding to your edit...

The image problem was an easy fix. I've set the maximum width of images to 100% of the container to stop overflow, rather than setting to fit content as it would not work well with small images.

Regarding the MathJax in titles. I'm not sure why that's happening nor how to solve it. It seems to happen when the title is taller than the title division, so it makes me wonder if MathJax is not doing something correctly. I'll have to ponder it. Maybe someone else has an idea that could help?
[/edit]
Image
impudens simia et macrologus profundus fabulae
User avatar
euler
Administrator
Posts: 5094
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: BBCode Update 2025

Post by euler »

Okay, unless I've broken something else, I've fixed the issue with the title using MathJax.
Image
impudens simia et macrologus profundus fabulae
GoodRiddance
Posts: 2
Joined: Wed Aug 06, 2025 11:59 am

Re: BBCode Update 2025

Post by GoodRiddance »

New to this forum so please forgive any unintended trespasses.

I've so far treated tags like "[code=...]" as case-insensitive, and so far with impunity. But, in the last few days, code starting with [Code ...], i.e. with a capital C, do not show up anymore. It can be fixed by changing the tag back to [code...] with lower c.

However, some c'ode produced by accounts that do not exist anymore cannot be edited like that.

Can you please fix this, e.g. by returning to case-insensitive tags? Many thanks.
hacatu
Posts: 45
Joined: Tue Dec 08, 2020 9:06 pm

Re: BBCode Update 2025

Post by hacatu »

I like option 2 for enumerated lists: the current behavior for `list=x` where x is not one of 1, a, A, i, I, or maybe some others I don't know about is to just fall back to a bulleted list, so even though using `list=10` or something to start at an offset is not standard BBCode, it should not be an incompatible extension (and I would find it useful in my ramblings)

Yes that's what I mean by nested code inside collapse, here is an example:

Code: Select all

[collapse=$\texttt{guess_hyper_recurrence}$]
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
[code=Python]
>>>> guess_hyper_recurrence(Ds[2::2], 2)
[Matrix([
[22],
[31],
[14],
[ 6],
[ 5],
[ 1]])]
>>>> guess_hyper_recurrence(Ds[3::2], 2)
[Matrix([
[24],
[31],
[15],
[ 2],
[ 5],
[ 1]])]
[    /    code]

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
[/collapse]
And here is a preview
Image
User avatar
euler
Administrator
Posts: 5094
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: BBCode Update 2025

Post by euler »

@GoodRiddance: Your feedback is very much welcomed and you had spotted an oversight. That will be fixed in my next update.

@hacatu: Thank you for the clarification and the screenshot. Actually, you have inadvertently helped me discover a more serious bug which I will also fix in the next update.


I will continue to work on the nested collapsible sections, but it will probably require a redesign to ensure they work as one would expect.
Image
impudens simia et macrologus profundus fabulae
User avatar
euler
Administrator
Posts: 5094
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: BBCode Update 2025

Post by euler »

I think I've managed to address all of the outstanding issues:
  • Ordered lists using Roman numerals have a wider left margin to accommodate more characters.
  • You can now use syntax like

    Code: Select all

    [list=i@3]
    to start a Roman numeral list at iii.
  • Collapsible sections have been redesigned and should expand properly with nested content.
  • Tall MathJax expressions in titles of collapsible sections doesn't cause the left margin of the content to be misaligned.
  • The code tag is case insensitive again.
Thanks to those that have reported issues. Please let me know if I've missed something or you find any other bugs.
Image
impudens simia et macrologus profundus fabulae
squenson
Posts: 2
Joined: Fri Aug 08, 2025 8:24 pm

Re: BBCode Update 2025

Post by squenson »

The third post in thread 177 (https://projecteuler.net/thread=177) does not display some characters properly.
The first post on page 4 also shows problems (https://projecteuler.net/thread=177;page=4).
I don't know whether they were correct before the change in the BBCode.
User avatar
euler
Administrator
Posts: 5094
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: BBCode Update 2025

Post by euler »

Thank you for letting me know about those posts. Both issues you reported should now have been fixed.
Image
impudens simia et macrologus profundus fabulae
squenson
Posts: 2
Joined: Fri Aug 08, 2025 8:24 pm

Re: BBCode Update 2025

Post by squenson »

Another case, in the last post of this page (https://projecteuler.net/thread=223;page=4), you will notice that the text changes to italic after a line of code. The OP copied his program as a text, so it is well possible that the combination of characters used in the program are similar to a markup tag.
User avatar
euler
Administrator
Posts: 5094
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: BBCode Update 2025

Post by euler »

There are certainly going to be more posts like that. When I re-wrote the BBCode module I had to make some hard choices. Although we have stuck to consistent BBCode syntax from the beginning, as new features have been added, some legacy posts were beginning to present challenges. That is, posts were made at the time that viewed perfectly well, but new tags began to interfere with them. Over the years I'd been building in code to accommodate these, but when I planned the new build I had to draw lines somewhere and fundamentally I decided that the priority was to build a robust parser. Most of the issues can be better solved by encouraging members to use tags properly. We'll have to learn to live with the small number of older posts that no longer view correctly. For example, that post would render fine if the program had been placed in code tags; I've just edited that particular post to fix it.

We may need to recruit a small trusted team to slowly work through the older posts to identify issues and edit them to fix the problems.
Image
impudens simia et macrologus profundus fabulae
User avatar
Obergscheidle
Posts: 21
Joined: Fri Jul 15, 2016 7:24 pm

Re: BBCode Update 2025

Post by Obergscheidle »

I am not sure whether it is related to the new version, but I noticed that after a change to a post (and even after giving a kudo to someone else's post) the update of the page does not work. The page remains empty and I have to reload to see the change. I observed this both in Chrome on a PC and on my Android phone, hence I guess it is not caused by some problem on my side.
Image
User avatar
euler
Administrator
Posts: 5094
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: BBCode Update 2025

Post by euler »

That was a temporary glitch. Hopefully it is working again now.
Image
impudens simia et macrologus profundus fabulae
PierrotLeFou
Posts: 32
Joined: Tue Jun 10, 2025 2:42 am
Location: Montreal, Canada
Contact:

Re: BBCode Update 2025

Post by PierrotLeFou »

Hi,
Maybe it's not pertinent here. I'm sorry but I'm blind and I didn't find the answer to it.
Can I put a link in BBCode like the html <a href="url">title</a> ?
I already know the MarkDown format [title](url). don't forget the period (.)
Thanks.
I'm always right ... until I'm wrong
User avatar
euler
Administrator
Posts: 5094
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: BBCode Update 2025

Post by euler »

No, you can't use HTML directly. Instead you make use of BBCode, which are tags using square brackets. There is a link on the main site when you compose a post that is titled "Formatting posts...". This gives guide to the tags that you can use. I'll post the link below which will take you directly to the guide, but let me know if it is not presented in a form that you are able to access.
https://projecteuler.net/about=forum_tags
Image
impudens simia et macrologus profundus fabulae
PierrotLeFou
Posts: 32
Joined: Tue Jun 10, 2025 2:42 am
Location: Montreal, Canada
Contact:

Re: BBCode Update 2025

Post by PierrotLeFou »

For french users, I found the following:
Groupe des utilisateurs du logiciel R - Guide du BBCode
It's also an excuse to practice ...
I didn't find how to escape open or close brackets.
Last edited by PierrotLeFou on Thu Aug 14, 2025 12:40 am, edited 2 times in total.
I'm always right ... until I'm wrong
Genuine
Posts: 1
Joined: Wed Sep 11, 2024 1:37 pm

Re: BBCode Update 2025

Post by Genuine »

Hi! I don't know if it's related, but I just noticed some of the LaTeX-written parts of some problems are not legible. Some i've seen are 156, 157, 163, 165, 166, 169, 170, 171, 180, 201, 212, 228 (i stopped checking at 230, so there might be more).
Post Reply