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

Consider lowlight for syntax highlighting #134

Open
marionebl opened this issue Jul 5, 2016 · 1 comment
Open

Consider lowlight for syntax highlighting #134

marionebl opened this issue Jul 5, 2016 · 1 comment

Comments

@marionebl
Copy link
Contributor

marionebl commented Jul 5, 2016

I noticed the rather involved code in the syntax highlighting server using cheerio to extract information from plain highlightjs output. I wonder if it would help code readability and performance to switch to lowlight or even emphasize, if possible.

Do you have interest in a change of this sort? I'd prepare a PR in the course of this week then.

@dbkaplun
Copy link
Member

dbkaplun commented Jul 6, 2016

This has been in my mind for some time (slap-editor/slap#117). I think this is a much-needed improvement, and will gladly accept a PR for this if it means we can stop manipulating HTML (read: remove cheerio as a dependency) in order to highlight a file. Although, if it ends up being slower, (which I would find very surprising), then we might have to reconsider.

I'm open to whatever library as long as it's relatively fast. I have not tried lowlight but it looks the best so far. I don't know if we can use emphasize here but you are free to try. Here are some other highlighting libraries I've found: atom/highlights, PrismJS, rse/syntax. Note that some of them also produce HTML so may not be acceptable as alternatives depending on rendering performance.

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

2 participants