question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.1.0 -> 1.1.1 breaks Python highlighting in Docusaurus

See original GitHub issue

Hi,

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:

image


But when using newest version, highlighting is missing for things like decorators (or applied partially):

  "resolutions": {
    "prism-react-renderer": "1.1.1"
  },

image


@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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
kittencommented, Jun 30, 2020

Hm, that’s odd, it should indeed still be 1.20.0. I may have to look into this a little further

0reactions
slorbercommented, Jun 30, 2020

Thanks.

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found