Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Highlight.JS from PrismJS - Discuss #44

Open
FlipperPA opened this issue Feb 11, 2024 · 5 comments
Open

Switch to Highlight.JS from PrismJS - Discuss #44

FlipperPA opened this issue Feb 11, 2024 · 5 comments
Assignees

Comments

@FlipperPA
Copy link
Owner

PrismJS no longer seems to be maintained. There are also some underlying issues with CSS namespacing that conflict with Wagtail's admin, particularly around the CSS class named comment.

I'm considering switching to highlight.js as our underlying syntax highlighting library.

Pros:

  • Resolves namespace conflicts
  • Actively maintained
  • More language support
  • More theme choice

Cons:

  • Current themes will no longer be supported
  • It's a big change, and other backwards incompatibilities might be found.

I wanted to open this issue for discussion to our users before moving in this direction. Thoughts?

@FlipperPA FlipperPA self-assigned this Feb 11, 2024
@vsalvino
Copy link

vsalvino commented Feb 13, 2024

If you wanted to switch to backend rendering / pygments, I have my old implementation archived here, which you're free to rip off: https://github.com/vsalvino/coderedcms-codeblock

The one thing I'd do differently is change the language list dropdown to a user-entered string instead, as the list is HUGE.

@smark-1
Copy link

smark-1 commented May 3, 2024

Highlight.js does not support line numbering. Is line numbering going to still be supported?

@FlipperPA
Copy link
Owner Author

@smark-1 There seems to be a plugin we can leverage, but good question:

https://github.com/wcoder/highlightjs-line-numbers.js/

@smark-1
Copy link

smark-1 commented Sep 20, 2024

The current versioning is based off of PrismJS. What would the versioning scheme be after switching?

@FlipperPA
Copy link
Owner Author

@smark-1 That's a great question. We might fork this to something like wagtail-highlight-js and start with HighlightJS versioning. Unfortunately, I haven't had the time to work on this, and there hasn't been a need at work.

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

No branches or pull requests

3 participants