1.1.0 -> 1.1.1 breaks Python highlighting in Docusaurus
See original GitHub issueHi,
Docusaurus (v2) uses this project for syntax highlighting.
https://v2.docusaurus.io/docs/theme-classic/#codeblock
Let’s take this code:
@dataclass
class MySQLConfig:
host: str = "localhost"
port: int = 3306
@dataclass
class Config:
db: MySQLConfig = MySQLConfig()
verbose: bool = True
cfg_store = ConfigStore.instance()
cfg_store.store(name="config", node=MyConfig)
@hydra.main(config_name="config")
def my_app(cfg: MyConfig) -> None:
# Python knows that the type of cfg.db is MySQLConfig without any additional hints
print(f"Host: {cfg.db.host}, port: {cfg.db.port}")
if __name__ == "__main__":
my_app()
When using:
"resolutions": {
"prism-react-renderer": "1.1.0"
},
Python highlighting works fine for this code:
But when using newest version, highlighting is missing for things like decorators (or applied partially):
"resolutions": {
"prism-react-renderer": "1.1.1"
},
@kitten as you proposed your help already here: https://github.com/facebook/docusaurus/pull/2666#issuecomment-619602671 wonder if you can help me figure out what’s happening.
The code does not seems to change much from 1.1.0 to 1.1.1 so I don’t understand.
Anything I don’t see in the commits?
Do you think this might affect other languages as Python, and that we should temporarily lock users to 1.1.0?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Code blocks | Docusaurus
Use the matching language meta string for your code block, and Docusaurus will pick up syntax highlighting automatically, powered by Prism ...
Read more >Style Guide | Sauce Labs Documentation
This document describes the options available for creating content for the site, along with some guidelines and conventions. Markdown. This ...
Read more >Dependencies | @docusaurus/plugin-content-docs | npm
arrow_right @docusaurus/core. 2.0.0‑beta.3 Notes Relation
Version 2.0.0‑beta.3 Published June 30, 2021 Description
arrow_right @docusaurus/mdx‑loader. 2.0.0‑beta.3 Notes Relation
Version 2.0.0‑beta.3 Published June 30, 2021 Description
Read more >Markdown Guide and Code | Unity Multiplayer Networking
s = "Python syntax highlighting". print(s). Copy. To highlight a line of code, add {#} with the line number in the brackets ......
Read more >GitHub releases - freshcode.club
MicheleCioccarelli / Dama C++ FTW against nonno v1.2 Now...
kartoza / charts Smarty Kartoza Helm charts for Kubernetes common...
madlib‑lang / madmarkdown‑parser no‑lang Markdown parser...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hm, that’s odd, it should indeed still be
1.20.0
. I may have to look into this a little furtherThanks.
How can I know which version is currently vendored in this lib?
The package says
"prismjs": "^1.20.0",
and it does seem to have changed, and it’s the latest version of Prism anyway. Is this the version vendored here?Here’s a PR that fixes a Docusaurus site: https://github.com/facebookresearch/hydra/pull/730/files#diff-133739a86bc2f5157391e0018e5f9d01R7409
The yarn lock versions of prism is still the same before/after