Skip to content

Added client-side highlighting using highlight.js #12

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

Merged
merged 3 commits into from
Nov 19, 2020

Conversation

bram-pkg
Copy link
Member

@bram-pkg bram-pkg commented Nov 19, 2020

Highlight.js has better highlighting for language constructs. This will highlight $faker in a different color, and operators, functions too.

Documentation for this can be found here:

Because we are using the navigation.instant feature (this loads a new page using XHR instead of a reload), the code blocks in a page wouldn't initialize after navigation. I added a small workaround for this using the DOMContentSwitch event.

Before: https://s3.bram.cloud/sharex-bram/chrome_iZ4C4AwoWn.png
After: https://s3.bram.cloud/sharex-bram/chrome_rZ0d7i2ldR.png

@bram-pkg bram-pkg requested review from Nyholm and pimjansen November 19, 2020 11:13
@bram-pkg bram-pkg removed the request for review from Nyholm November 19, 2020 16:10
@pimjansen pimjansen merged commit 8ed94da into main Nov 19, 2020
@pimjansen pimjansen deleted the better-highlighting branch November 19, 2020 16:56
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.

2 participants