Render codes line by line
See original GitHub issueI am writing a project that use highlight.js
render code, but some code to be split line by line. result in some html mark not closure.
e.g, hljs.highlight('cpp','/*aa\nbb\ncc*/').value
output (version 8.0)
<span class="hljs-comment">/*aa
bb
cc*/</span>
But I hope the result is
<span class="hljs-comment">/*aa</span>
<span class="hljs-comment">bb</span>
<span class="hljs-comment">cc*/</span>
Issue Analytics
- State:
- Created 10 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
codemirror rendering code on single line - Stack Overflow
I've always used a textarea tag to initialise codemirror. It's how it's done on the main site. Just tested it and it Works...
Read more >Rendering Lines in a Game Engine // Game Engine series
Understanding Code You Didn't Write // Code Review · Dirty Flags in Rendering | Coding a 2D Game Engine in Java #15 ·...
Read more >Rendering Line Lights - The Code Corsair
All the above engines use this idea in varying forms. We'll describe the line light as a segment formed by points A and...
Read more >How to Format Code in Markdown - freeCodeCamp
There are two ways to format code in Markdown. You can either use inline code, by putting backticks (`) around parts of a...
Read more >Render GitHub source (with line-range) as code-block
Does anyone know of a method of rendering a range of GitHub source as a code-block? I found a plugin that will render...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(Continued https://github.com/highlightjs/highlight.js/issues/3303 so that we didn’t need to discuss in a closed issue)
Working!! 👍
Thank you very much!