summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Carstairs <jcarstairs@scottlogic.com>2026-09-08 09:34:27 +0100
committerJoe Carstairs <jcarstairs@scottlogic.com>2026-09-08 09:34:27 +0100
commit50ea9e34dfb990066927f8981ec0bda209bb24da (patch)
tree2d11ec5351958e210f23295991bac2c6aae1fb14
parentb12dd3b2c810a9131b0efecb61b3fa7e6d2c0941 (diff)
fix: rendering gmi pre blocks to html
-rwxr-xr-xhttp/bin/gmi2upphtml15
1 files changed, 11 insertions, 4 deletions
diff --git a/http/bin/gmi2upphtml b/http/bin/gmi2upphtml
index 1631037..0d16c56 100755
--- a/http/bin/gmi2upphtml
+++ b/http/bin/gmi2upphtml
@@ -165,15 +165,22 @@ do
if [ "$(echo "$line" | cut -c1-3)" = "\`\`\`" ]
then
- close_all_open_blocks_except pre
if [ $is_in_preformatted_block -eq 0 ]
then
+ close_all_open_blocks_except pre
echo "<pre>"
+ is_in_preformatted_block=1
+ echo "$(escape_upphtml "$(echo "$line" | cut -c4-)")"
else
- echo -e "\n"
+ echo "</pre>"
+ is_in_preformatted_block=0
fi
- is_in_preformatted_block=1
- echo "$(escape_upphtml "$(echo "$line" | cut -c4-)")"
+ continue
+ fi
+
+ if [ $is_in_preformatted_block -ne 0 ]
+ then
+ echo "$(escape_upphtml "${line}")"
continue
fi