-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its executiongood first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.If you are just getting started with Docusaurus, this issue should be a good place to begin.help wantedAsking for outside help and/or contributions to this particular issue or PR.Asking for outside help and/or contributions to this particular issue or PR.
Description
🐛 Bug Report
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
- In
siteConfig.js, in thehighlightfield, add this:wherehljs: function(hljs) { hljs.registerLanguage('reason', reasonHighlightJs) }
reasonHighlightJsis an existing callback that adds a new highlighter. - Run dev, see that the custom highlighting works
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 against yarn docusaurus-build in the generated docs 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its executiongood first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.If you are just getting started with Docusaurus, this issue should be a good place to begin.help wantedAsking for outside help and/or contributions to this particular issue or PR.Asking for outside help and/or contributions to this particular issue or PR.