diff options
author | bptato <nincsnevem662@gmail.com> | 2024-08-11 13:56:45 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-08-11 13:56:45 +0200 |
commit | 77aaafba20fd354625985bd65dce046cab759c63 (patch) | |
tree | 49b8b287a65e4520b442be90c39d6a60464d190d /adapter/format | |
parent | fd31a6691e8553bc782c31d695af1d6ee4811c41 (diff) | |
download | chawan-77aaafba20fd354625985bd65dce046cab759c63.tar.gz |
md2html: label headings with their level
like sr.ht does
Diffstat (limited to 'adapter/format')
-rw-r--r-- | adapter/format/md2html.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/adapter/format/md2html.nim b/adapter/format/md2html.nim index 4c3fcaa3..5d06acc5 100644 --- a/adapter/format/md2html.nim +++ b/adapter/format/md2html.nim @@ -209,7 +209,8 @@ proc parseHash(line: openArray[char]): bool = break H = max(L - 1, H) let id = line.toOpenArray(L, H).getId() - stdout.write("<H" & $n & " id='" & id & "'>") + stdout.write("<H" & $n & " id='" & id & "'><A HREF='#" & id & "'>" & + '#'.repeat(n) & "</A> ") line.toOpenArray(L, H).parseInline() stdout.write("</H" & $n & ">\n") return true |