[WIP] Replace Highlight.js with Prism#4400
Conversation
|
This PR came up during today's sync, so I pulled it down to see how much work is left. Got it updated with upstream before realizing that I don't have any ideas at the moment, but this casts doubt on being able to use cc// @chandlerprall |
|
Yep. I wondered if we would just want to use Prism directly. The primary reason I went to I knew it has hightlight.js as a dep, but thought it was an either/or situation. |
Same. I was surprised when I went digging. |
|
https://github.com/FormidableLabs/prism-react-renderer looks pretty interesting, as an alternative |
|
@thompsongl That looks like it'd be a pretty seamless switch and still supports the CSS side with a JS theme that we could use with emotion. Lemme see if I can get you a fresh PR similar to this one. Then I can pass it back. Won't close out virtualization, but we can likely add that on our own with react-window in a later step. |
|
After talking with @chandlerprall yesterday about the highlight.js timeline, I started looking into this again. First some background:
So Do/Did we actually intend to support non-string/non-code Another change is that cc// @cchaos on this also |
|
To get to the heart of your question. I think it's perfectly acceptable for it to ONLY accept string content. |
|
I have just about enough work completed to open a new PR. It might be easier to understand the differences and what breaking changes will be introduced. |
|
Closing this PR; moving discussion to #4638 |
Summary
Replaces our usage of highlight.js with Prism through https://github.com/react-syntax-highlighter/react-syntax-highlighter
Gives us the ability to add virtualization at some point.
Still has the following issues:
EuiMarkdownEditorEuiCodeChecklist