Syntax highlighting not working in a post on my site

Hi, had no problems with syntax highlighting on my site appart in that particular post, for an unknown reason, any idea? (I forced lisp syntax)

Does it work in safe mode?

לייק 1

Yes it does. Didn’t think about trying because all the other posts work.

@patrickemin what do you want to do with this topic? Should we delete it or is there an actual problem here you need help with? If so can you provide enough detail so we can help you and maybe a screnshot?

Actually, I still have this problem: syntax highlighting doesn’t work for this particular post, but it works for all the others. And so, after testing in safe mode, syntax highlighting works for all posts. This does not explain why, for this particular post, which is nothing out of the ordinary, syntax highlighting does not work when not in safe mode.

If you were to copy/paste that post into a PM here, would it work?

From what I can tell, I think it’s the Code-block line numbers theme component. Specifically with the lisp language.

Are there other snippets in lisp that work in other posts? (Just to help narrow down if it’s something specific to that codeblock or if it’s the lisp syntax itself)

3 לייקים

Yes it’s working everywhere else, for example here.

Well actually there are two TCs, syntax highlighting and line numbering that should act when I post code on my site, line numbering works but syntax highligting does not (only for that post)

And it seems that I wasn’t very clear when I made my request. I’ll try to rephrase it as best I can below. On my Discourse site, someone posted a message containing autolisp programming code. Normally, with the two components I have installed on my site, which are syntax highlighting and automatic line numbering, this code should be numbered automatically and the lisp language syntax should appear highlighted. This does not work, and I want to emphasize that it is only for this post, because it works for all the others. So only for this post, the line numbering works fine, in fact, I have never reported this problem. But the syntax highlighting does not work. I don’t know why this component theme does not work for this post only, and why it works for all the others.

I think it may be the size of the snippet. When I (very roughly :slight_smile:) chop out a chunk of the first one to make it smaller it then highlights as expected.

(In combination with the codeblock line numbering theme component)

לייק 1

Ah ok that could be a hint. In fact, I quickly checked and I probably never had a code of that length on my site (I do not know what the maximum length is)

לייק 1

If you disable the line numbering component you should be able to see that the highlighting works as expected (like in safe mode, but more specific). So it appears to be a limitation in the theme component. I’m not sure on the specifics though.

לייק 1