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.

Code highlighting not working when & in html code

See original GitHub issue

Describe the problem

I inserted some html code blocks in my markdown files.

I expected colored codes, but there were some code blocks were full of black letters. After trial and error, I found out that this was due to &. image

It seems it’s because & is used for html entities. 🤔

If I use &, the codes are highlighted but the color stands out too much… 🥺 image

Is there any other way but to replace the character?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
chrisjsewellcommented, Aug 15, 2021

During the build, I found the following message:

is that with the &? because that is definitely not allowed in HTML

0reactions
devplacommented, Aug 15, 2021

Oh, I see. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML syntax not highlighting correctly - Stack Overflow
I solved the issue. I realised that once when I was meddling with something I added by accident a single character to the...
Read more >
Embedded Syntax Highlighting in HTML files not working
Currently, it seems that only the HTML highlighting is used independent of what other language may be embedded, i.e. css or js.
Read more >
Javascript syntax highlighting it not working
I have an .html file which is part of a large project, and in the middle of the file, syntax highlighting just flat...
Read more >
HTML formatting inside code blocks doesn't work if syntax ...
I have plenty of old answers where I used <pre><code> to format code, with HTML tags such as <b> or <strike> inside such...
Read more >
Prism
PrismJS Tutorial | Implement Prism in HTML and React; Code syntax highlighting in Pug with :highlight and :markdown filters using pug-loader and Prism.js....
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