You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Github, codeblocks without syntax-highlighting preserves leading/trailing newlines:
```
const x
```
renders as:
const x
But when the language is specified, and theres syntax-highlighting, like:
```javascript
const x
```
it trims leading/trailing newlines when rendered:
constx
This CANNOT be circumvented with HTML-syntax like below. It still trims the newlines.
<pre lang="javascript"><code>
const x
</code></pre>
A possible fix would be to add 1 space to the front and back each, like: (this example has double newlines on both ends, to show that u only need 1 space at the front and back)
```javascript
[SPACE]
const x
[SPACE]
```
The text was updated successfully, but these errors were encountered:
EvitanRelta
changed the title
Codeblock syntax-highlighting trims leading/trailing newlines
In Github, codeblock syntax-highlighting trims leading/trailing newlines
Sep 20, 2022
In Github, codeblocks without syntax-highlighting preserves leading/trailing newlines:
renders as:
But when the language is specified, and theres syntax-highlighting, like:
it trims leading/trailing newlines when rendered:
This CANNOT be circumvented with HTML-syntax like below. It still trims the newlines.
A possible fix would be to add 1 space to the front and back each, like:
(this example has double newlines on both ends, to show that u only need 1 space at the front and back)
The text was updated successfully, but these errors were encountered: