Skip to content

Is it possible to mix mermaid and code block highlighting in the same file? #281

Answered by aneksteind
aneksteind asked this question in Q&A
Discussion options

You must be logged in to vote

I gave up -- it looks like prism strips HTML, and I think that's the root of the problem. I decided to go with highlight.js instead and was able to get that to work:

js:
  # Syntax highlighting using highlight.js
  syntax: |
    <link rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/hybrid.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/languages/haskell.min.js"></script>
    <script>hljs.highlightAll();</script>

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@srid
Comment options

Comment options

You must be logged in to vote
2 replies
@srid
Comment options

@aneksteind
Comment options

Answer selected by aneksteind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants