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

Add hljs class to all code blocks #1645

Merged
merged 1 commit into from
Jul 16, 2021
Merged

Add hljs class to all code blocks #1645

merged 1 commit into from
Jul 16, 2021

Conversation

fredrikekre
Copy link
Member

This adds hljs to all code blocks for two reasons:

  • nohighlight blocks are left untouched by HighlightJS, meaning that
    the hljs class isn't attached at runtime to those blocks. Adding this
    explicitly makes sure that CSS rules for code blocks still apply
    such that the correct "regular text color" is used.
  • If JavaScript is disabled in the browser this makes sure that at
    least the intended "regular text color" is used for code blocks.

@fredrikekre
Copy link
Member Author

Before:
Screenshot from 2021-07-14 13-50-09

After:
Screenshot from 2021-07-14 13-49-29

(The green color is just to show what is highlighted with the code color).

@fredrikekre fredrikekre added the Format: HTML Related to the default HTML output label Jul 14, 2021
@fredrikekre fredrikekre force-pushed the fe/hljs branch 2 times, most recently from e386f6d to 10cddab Compare July 15, 2021 16:05
This adds hljs to all code blocks for two reasons:

 - nohighlight blocks are left untouched by HighlightJS, meaning that
   the hljs class isn't attached at runtime to those blocks. Adding this
   explicitly makes sure that CSS rules for code blocks still apply
   such that the correct "regular text color" is used.
 - If JavaScript is disabled in the browser this makes sure that at
   least the intended "regular text color" is used for code blocks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Format: HTML Related to the default HTML output Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants