Syntax highlighting in code blocks is random

Steps to reproduce

Write some shell command line snippets as multi-line code blocks (triple backticks):

Expected result

Syntax highlighting makes sense or there no highlighting at all.

Actual result

Highlighting seems random. The worst - some executable code rendered as comments (marked on screenshot)

Environment

Which operating system are you using? Windows 10
Which browser are you using? Chrome 89.0.4389.90
If you’re using a desktop or mobile app, what’s the version number of Dynalist? Desktop and web 1.4.5
Are you using any third-party scripts for Dynalist, e.g. PowerPack? No


Additional information

This is probably due to language (mis)detection. If it’s impossible to do get it right, there must be an option to disable. Wrong highlighting is much worse than no highlighting at all

1 Like

Weird. Maybe just use the single backtick for code to avoid the colors.

`blah
blah
blah`

Thanks! Single backticks helped somewhat. But now I miss that “Copy” button and selecting text by hand is not easy in this case.

Could also trick it into thinking everything’s a python comment.

```"""
blah
blah
"""```

Looks like dynalist loads something called highlightjs
image

Maybe there’s some trick to specify a language in it’s documentation.

https://highlightjs.org/

That’s definitely an oversight… Will see if we can allow specifying the language soon.