diff options
author | davidovki <david@davidovski.xyz> | 2023-03-03 05:08:51 +0000 |
---|---|---|
committer | davidovki <david@davidovski.xyz> | 2023-03-03 05:08:51 +0000 |
commit | 6bc6d5fb6b72fb899587d7bd20caa2896d528c2d (patch) | |
tree | 4330032d18364f56b88b21760e0954e17e5ae6e0 /src | |
parent | b1ffc4b5ba572a5e4070d162888c4c92b94a62c1 (diff) |
Fix paragraph
Diffstat (limited to 'src')
-rwxr-xr-x | src/md2html.sh | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/md2html.sh b/src/md2html.sh index 86ebc3d..bc21764 100755 --- a/src/md2html.sh +++ b/src/md2html.sh @@ -85,14 +85,16 @@ _p () { empty=true while IFS= read -r line; do case "$line" in - "#"*|">"*|"``"*) - printf "%s\n" "$line" + "#"*|">"*|'``'*|'<'*'>'*) + $empty && + printf "%s\n" "$line" ;; "") - $empty || + $empty || { printf "</p>\n" - - empty=true ;; + empty=true + } + ;; *) $empty && printf "<p>%s " "$line" || @@ -250,10 +252,10 @@ _ol () { # md2html () { - _p \ - | _pre_emph \ + _pre_emph \ | _ul \ | _ol \ + | _p \ | _emph '__' "<strong>" "</strong>" \ | _emph '_' "<em>" "</em>" \ | _emph '`' "<code>" "</code>" \ |