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 Syntax Highlighting not Working

See original GitHub issue

Hello, great plugin,

After following the Syntax highlight section of the README the code, as in your examples, is not highlighting:

Inline `code` has `back-ticks around` it.

> ```javascript
> var soop = "JavaScript syntax highlighting";
> alert(s);
> ```
> 
> ```python
> s = "Python syntax highlighting"
> print s
> ```

Any ideas what could be wrong? Thanks

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jfcerecommented, Sep 19, 2018

@ghiscoding this is due to the fact that leading/trailing whitespaces are meaningful in markdown because they serve a purpose.

For this reason, when you are doing the following … it means you want white spaces in front of lines 4 and up:

ngOnInit() {
  this.markdownText =
    `### Markdown example
    ---
    \`\`\`typescript
    public markdown = "# Markdown";
    \`\`\``;
}

By doing the following … you are removing leading spaces in front of lines 4 and up:

ngOnInit() {
  this.markdownText =
`### Markdown example
---
\`\`\`typescript
public markdown = "# Markdown";
\`\`\``;
}

Honestly I always found it easier to use src input property to fetch remote files as it has the following advantages:

  • won’t need to escape anything like curly braces or back-ticks
  • will respect the indentation in the file
  • will auto-detect language for syntax highlight if you set your file with the right extension
0reactions
ghiscodingcommented, Sep 19, 2018

@jfcere Thanks for the explanation, I guess that is why you added this new ngPreserveWhitespaces and delete the white spaces by default in the newer version. I guess what I could do on my side to quick fix this is to simply remove all white spaces myself from the variables. that should work too. I understand now thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Code syntax highlighting not working
I am using Visual Studio Code (VSC) as my IDE. My computer just updated to Catalina 10.15. 2 (19C57) and since the update,...
Read more >
Syntax highlighting not working : r/vscode - Reddit
I've tried to reinstall vscode, completely whipping existing settings, but nothing works. Any help would be appreciated!
Read more >
Syntax highlighting not working for Python in VS Code with ...
Uninstalling the Python for VSCode extension fixed the issue. All reactions.
Read more >
Setting up code syntax highlighting using the Visual Studio ...
The syntax highlighting was the first Language Server Protocol feature in 4D v19 R6. Let's see how to customize your source code rendering....
Read more >
How to enable semantic highlighting in VS Code - Stefan Judis
Semantic syntax highlighting makes sure your source code is not only beautifully colored, but that used the colors are logical, too. After ...
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