Highlightjs custom highlighting config ignored in production #960
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
good first issue
If you are just getting started with Docusaurus, this issue should be a good place to begin.
help wanted
Asking for outside help and/or contributions to this particular issue or PR.
🐛 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: