Make prismjs shortcode CRLF tolerant

Checks for extra line in the form of `\r\n` or `\n` so that it's recognized and removed appropriately when edited in a CRLF editor
This commit is contained in:
Caleb Frey 2021-07-13 17:36:00 -04:00 committed by GitHub
parent ca1cc0c391
commit 9fcd6f2e83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
{{ $inner := replaceRE "^\n" "" .Inner | string }}
{{ $inner := replaceRE "^\r?\n" "" .Inner | string }}
{{ if len .Params | eq 0 }}
<pre><code>{{ $inner }}</code></pre>
{{ else }}