I have a code block that is correctly shown when tested at
https://prismjs.com/test.html#language=maxscript, and verified to be working at
https://github.com/PrismJS/prism/pull/3181 after the original request here
https://github.com/PrismJS/prism/issues/3059. I am trying to get the syntax highlighting to be shown the same within Obsidian. I created a quick test vault (see screenshot below) to demonstrate the differences. Perhaps some of the changes described in my first github link above may not have fully come through properly.
It is curious because the implementer of the MAXScript language into Prismjs wrote this after I had earlier pointed out that these functions were not coming through in Prismjs. They wrote:
" Added function calls (as
[requested](https://github.com/PrismJS/prism/issues/3059#issuecomment-963732805) by [@I-d-as](https://github.com/I-d-as)). The detected syntax is intentionally restrictive to prevent false positives. This leads to a few false negatives (e.g. around
casestatements) but I think that’s okay for now."
This is taken from
Anyways, here is a screenshot that shows the Obsidian v0.14.2 Help Vault with the same code shown in the GitHub issue in links. I also have two browser windows open showing the original source of the code
https://help.autodesk.com/view/MAXDEV/2022/ENU/?guid=GUID-4ED6C9C6-53B3-437C-969E-B8C924DF34AA and a preview on the test drive Prismjs page
In case someone was actually going to test my example, the language is MAXScript, so you can simply add “maxscript” without the quotes after the three backticks signifying the start of the code block. The script I showed was copied from this page
When I preview the code, various functions do not get highlighted. I know this is not a top priority, but since the code previews correctly within PrismJs website test drive feature, maybe there is some sort of quick fix that will make it work.
I would think (not necessarily expect) that the syntax highlighting would match PrismJs website’s test drive feature, since Obsidian uses Prismjs.
The actual result is that many functions do not get highlighted.
- Operating system: Windows 10
Thanks so much for considering this. I originally made a post here using the help category: Is it normal for code preview not to match prismjs test drive?