Skip to content

add basic syntax highlighting of code blocks with highlight.js#54

Open
thavelick wants to merge 2 commits into
deiucanta:mainfrom
thavelick:highlight-code
Open

add basic syntax highlighting of code blocks with highlight.js#54
thavelick wants to merge 2 commits into
deiucanta:mainfrom
thavelick:highlight-code

Conversation

@thavelick

@thavelick thavelick commented May 26, 2023

Copy link
Copy Markdown

for #35

This implementation works but has a few potential issues that may or may not be a problem for the maintainers:

  1. There's a typescript error because the <Code> component expects children, but we can't provide both children and dangerouslySetHtml
  2. There may be a better way to exclude children from props before passing them to <Code>.
  3. There may be a better way to convert children to a string before passing to hljs.
  4. The background color for code blocks seems to come from the markdown display library rather than hljs. With the github.css theme currently used this looks fine, but other hljs themes can look pretty bad as they expect a black background.

@thavelick

Copy link
Copy Markdown
Author

Also - not sure if I should be including the changes to package-lock.json and yarn-lock.json. Let me know if I should exclude those

@OctopBP OctopBP mentioned this pull request Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant