diff options
| author | Joe Carstairs <me@joeac.net> | 2026-09-08 18:23:10 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-09-08 18:23:10 +0100 |
| commit | 4c61414d3fe57829e177151939a97d72d603d636 (patch) | |
| tree | 3830db5001e46956976c5f1d32aada834f7c7378 /http/bin | |
| parent | bb97b1dc82c88a977ceafae2ac0e383a57025280 (diff) | |
fix closing ```
Diffstat (limited to 'http/bin')
| -rwxr-xr-x | http/bin/gmi2upphtml | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/http/bin/gmi2upphtml b/http/bin/gmi2upphtml index ace3ef2..433aa8d 100755 --- a/http/bin/gmi2upphtml +++ b/http/bin/gmi2upphtml @@ -105,7 +105,12 @@ while read line do if [ $is_in_preformatted_block -ne 0 ] then - echo "$(escape_upphtml "${line}")" + if [ "$(echo "$line" | cut -c1-3)" = "\`\`\`" ] + echo "</code></pre>" + is_in_preformatted_block=0 + else + echo "$(escape_upphtml "${line}")" + fi continue fi @@ -171,15 +176,9 @@ do if [ "$(echo "$line" | cut -c1-3)" = "\`\`\`" ] then - if [ $is_in_preformatted_block -eq 0 ] - then - close_all_open_blocks_except pre - echo "<pre><code>" - is_in_preformatted_block=1 - else - echo "</code></pre>" - is_in_preformatted_block=0 - fi + close_all_open_blocks_except pre + echo "<pre><code>" + is_in_preformatted_block=1 continue fi |
