question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Render codes line by line

See original GitHub issue

I 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:closed
  • Created 10 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
tomasreimerscommented, Aug 9, 2021

(Continued https://github.com/highlightjs/highlight.js/issues/3303 so that we didn’t need to discuss in a closed issue)

1reaction
Aimeastcommented, Jul 25, 2014

Working!! 👍

Thank you very much!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found