hljs - Added compatibility for CSS styles.#30
Merged
JLHwung merged 3 commits intohexojs:masterfrom Dec 20, 2017
Merged
Conversation
2 tasks
Contributor
Author
|
FYI: Don't approve the PR yet, there's a bug with the line numbers at the moment due to letting hljs render the lines on its own terms. I'm about to call it a night, but I should have time to fix it up tomorrow. |
Contributor
Author
|
I think this should cover it. I've tested it with and without the gutter. Line numbering works fine, but it's obviously not styled via highlight.js themes. Let me know if there's anything you'd change about the code. Cheers, |
Contributor
|
@alxbl Good job! Please document the |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds additional support to render the highlighting with
hljs-prefix and preserves backward compatibility for existing themes/stylesheets.Support for both marked lines and line numbers, as well as vanilla highlight.js blocks is included.
This is a quick proof of concept that I whipped up after I started working on my theme and realizing that hljs CSS themes weren't supported. I hope it can be helpful to hexo users.
It's a two part pull request as hexo/#2901 adds support for propagating the
hljsconfiguration through to the highlight plugin.If everything is good (or after necessary changes), I will be updating the documentation as well to document the new config for
_config.yml.Cheers,