Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prism syntax highlighting is active even when prism_syntax_highlighting is false #729

Closed
chalin opened this issue Oct 16, 2021 · 11 comments
Closed

Comments

@chalin
Copy link
Collaborator

chalin commented Oct 16, 2021

Visit the Docsy User Guide section Look and Feel >> Color palette and other styles. This is the first code block of that section, as syntax highlighted by Chroma:

Screen Shot 2021-10-16 at 3 13 19 PM

You'll see that only briefly since Prism sweeps over, changing the highlighting to this:

Screen Shot 2021-10-16 at 3 11 09 PM

The problem seems to be that MarkMap (#612) is loading prism, as we can see from the Network view:

Screen Shot 2021-10-16 at 3 19 41 PM
@chalin chalin changed the title Prism syntax highlighting is active even when prism_syntax_highlighting = false Prism syntax highlighting is active even when prism_syntax_highlighting is false Oct 16, 2021
@chalin
Copy link
Collaborator Author

chalin commented Oct 16, 2021

/cc @nate-double-u @celestehorgan

@chalin
Copy link
Collaborator Author

chalin commented Oct 16, 2021

Actually, if you refresh a few times you might see this syntax highlighting:

Screen Shot 2021-10-16 at 3 29 55 PM

This seems to correspond to when there are 404 errors in the console, like these:

GET https://cdn.jsdelivr.net/npm/prismjs@1.23.0/components/prism-mhchem.min.js net::ERR_ABORTED 404

@LisaFC
Copy link
Collaborator

LisaFC commented Oct 19, 2021

Huh, that's very weird (and new - I hadn't updated Docsy-example to the latest Docsy version since last month and it's still using Chroma normally) - I'll look at how the CSS is loading, as as far as I can see I last updated Docsy-example after I merged the Markmap PR.....

@LisaFC
Copy link
Collaborator

LisaFC commented Oct 19, 2021

So it seems to be only happening in the page with the MarkMap diagram in it - if you look at all the other pages, the docs are still using Chroma. Let me see if I can fix it.

@LisaFC
Copy link
Collaborator

LisaFC commented Nov 3, 2021

So I have "fixed" this indirectly by moving the MarkMap diagram to a different page in #750 ...

This does not solve the fact that it seems to be loading the Prism files for some reason (does the code in a MarkMap use Prism by default, I wonder?), which will affect every other code snippet on the page. I'll poke at it some more.

@LisaFC
Copy link
Collaborator

LisaFC commented Nov 3, 2021

AHA. If I take the fenced code block out of our example MarkMap, the other code blocks on the page use Chroma, as specified. I now just need to figure out how to stop it loading Prism (or if it's possible...).

@LisaFC
Copy link
Collaborator

LisaFC commented Nov 3, 2021

Yep, Markmap uses/loads Prism by default - you can switch it off as an option if you're running it from the command line, but we're using an autoloader script that has no parameters. Might file an issue in their repo to see if it's configurable and put a warning/tip in our docs for now - does that make sense?

@chalin
Copy link
Collaborator Author

chalin commented Nov 3, 2021

Good job tracking that down! Sure that makes sense. If that sort of configuration isn't possible, then maybe we can simply document that hardcoded dependency in the user guide.

@chalin
Copy link
Collaborator Author

chalin commented Aug 9, 2022

@LisaFC - any updates?

@LisaFC
Copy link
Collaborator

LisaFC commented Aug 11, 2022

Thanks for the reminder, looks like it should now be possible to disable Prism in the autoloader so I'm going to give it a try...

emckean added a commit that referenced this issue Aug 15, 2022
LisaFC pushed a commit that referenced this issue Aug 16, 2022
@LisaFC
Copy link
Collaborator

LisaFC commented Aug 16, 2022

Fixed in #1175

@LisaFC LisaFC closed this as completed Aug 16, 2022
fekete-robert pushed a commit to fekete-robert/docsy that referenced this issue Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants