diff options
author | Nicholas Johnson <nick@nicholasjohnson.ch> | 2024-05-02 00:00:00 +0000 |
---|---|---|
committer | Nicholas Johnson <nick@nicholasjohnson.ch> | 2024-05-02 00:00:00 +0000 |
commit | 4b02ee6ac412cf1111dfb3c34e0ebd8adfd5758115aaea25ccee8658d6d7e590 (patch) | |
tree | eef66abf7128d656baf0009ec28657e4079be89f1954858f6a6f08d8c3261c38 /layouts | |
parent | 760689a40925e3f8445310fd5410e8e56265d409a071f25f2db253721f84c982 (diff) | |
download | hugo-theme-journal-4b02ee6ac412cf1111dfb3c34e0ebd8adfd5758115aaea25ccee8658d6d7e590.tar.gz hugo-theme-journal-4b02ee6ac412cf1111dfb3c34e0ebd8adfd5758115aaea25ccee8658d6d7e590.zip |
Improve comments
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/single.gmi | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index f00b1d1..a8be38d 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -13,7 +13,7 @@ {{ $content := chomp (.RawContent) -}} {{ $scratch := newScratch -}} -{{/* if content begins with a heading, add an extra space */ -}} +{{/* if content begins with a heading, add an extra newline */ -}} {{ if (findRE `^#{1,6} ` $content 1) }} {{ end -}} @@ -68,7 +68,7 @@ {{/* trim extra heading symbols */ -}} {{ $rendered_text = $rendered_text | replaceRE `(?m)^####{1,3} ` "### " -}} - {{/* convert alternative heading syntax to number signs */ -}} + {{/* convert Markdown alternative heading syntax to gemtext heading syntax */ -}} {{ $rendered_text = $rendered_text | replaceRE `(?m)^[\t ]*(\S.+?)[\t ]*\n\=+$` "# $1" -}} {{ $rendered_text = $rendered_text | replaceRE `(?m)^[\t ]*(\S.+?)[\t ]*\n\-+$` "## $1" -}} @@ -77,10 +77,10 @@ {{ $rendered_text = $rendered_text | replaceRE `\*{2}(\S|\S.*?\S)\*{2}` "$1" -}} {{ $rendered_text = $rendered_text | replaceRE `\*{1}(\S|\S.*?\S)\*{1}` "$1" -}} - {{/* convert alternative unordered lists symbols to asterisks */ -}} + {{/* convert Markdown alternative unordered list syntax to gemtext unordered list syntax */ -}} {{ $rendered_text = $rendered_text | replaceRE `(?m)^[-+] ` "* " -}} - {{/* convert Markdown ordered list item to gemtext unordered list item */ -}} + {{/* convert Markdown ordered list items to gemtext unordered list items */ -}} {{ $rendered_text = $rendered_text | replaceRE `(?m)^[1-9]\d*\.[\t ]+(.*?)[\t ]*$` "* $1" -}} {{ $rendered_text = $rendered_text | emojify -}} |