-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Highlightjs custom highlighting config ignored in production #960
Comments
As far as I'm aware, the only place where we define the highlightjs is only on that file. I checked the git blame and it seems that it has been like this since the initial release.
I think the patch is the correct way to do it. Thanks for reporting :) |
Hi, can I attempt this ? |
@rishacha sure, send a PR in 👍 |
* Added line for syntax definition #960 * chore: nits & fix for v2 as well
🐛 Bug Report
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
siteConfig.js
, in thehighlight
field, add this:reasonHighlightJs
is an existing callback that adds a new highlighter.Expected behavior
Run prod, see that the custom highlighting should be picked up
Actual Behavior
Highlighting isn't picked up =(
Reproducible Demo
Check out reasonml/reasonml.github.io@2c7b36f then
cd website && yarn && yarn start
, compare some resulting highlighting html againstyarn docusaurus-build
in the generateddocs
folder.Solution
This is caused by dev & prod not sharing the same code path. They have diverged quite a bit from what I'm seeing. I've patched this like so: chenglou@bade05e
As a matter of fact,
siteConfig.hightlight.hlgs
is never called anywhere in prod!This patch works, but I'm not too sure this is the right way to go. The dev & prod flow should probably be much closer. There are likely other hidden bugs.
The text was updated successfully, but these errors were encountered: