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.

Blank line in start

See original GitHub issue

blank_highlight

blank line - above the code snippet . . My sample code

<pre><code class="language-css">
	.class{
	font-size: 0.85rem;
	font-weight: 600;
	font-family: monospace;
	}
	h1 .header{
	font-size: 1.5rem;;
	font-family: Arial;
	}
	</code></pre>

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
joshgoebelcommented, Mar 18, 2021

No. We purposely do not modify your content. If someone wants space at the beginning, they can have it.

You could write a tiny plugin:

https://highlightjs.readthedocs.io/en/latest/plugin-api.html#before-highlightelement-el-language

Just before the highlighting trim the whitespace yourself by modifying the DOM…

0reactions
joshgoebelcommented, Mar 19, 2021

I already offered the solution: https://github.com/highlightjs/highlight.js/issues/3054#issuecomment-801916563

IF you want to strip the space then either use a plugin (see documentation) OR simply loop over the DOM yourself and strip the space from every code block before you even ask us to highlight them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add a blank line before the first line in a text file with awk
I have some text files. I would like to add a blank line before the first line in each text file ...
Read more >
awk starting from a fixed text, until the first blank line
If I use grep -ve ^$ the blank lines get removed, so there's no special characters. If I try to extract a different...
Read more >
Rule request: Ability to force a blank line at the start of scope ...
I need to customize the blankLinesAtStartOfScope rule to insert blank lines instead of removing them. I thought of writing a PR, but there...
Read more >
Blank Line and Empty Line Removal - Togaware
We can remove blank lines using awk: $ awk NF < myfile.txt Linux has many powerful command line tools dating from the 1970's....
Read more >
Line breaks and blank spaces - Overleaf, Online LaTeX Editor
The most standard way how to break lines is to create a new paragraph. This is done by leaving an empty line in...
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