Lagrange [release]

Gemtext markup was visible with Monospace Body

401e937ad83d0989bf144f2777c72299f95292d5
diff --git a/src/gmdocument.c b/src/gmdocument.c
index f5ce90a1..a26f9212 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -122,10 +122,12 @@ static enum iGmLineType lineType_GmDocument_(const iGmDocument *d, const iRangec
     return text_GmLineType;
 }
 
-static void trimLine_Rangecc_(iRangecc *line, enum iGmLineType type) {
+static void trimLine_Rangecc_(iRangecc *line, enum iGmLineType type, iBool normalize) {
     static const unsigned int skip[max_GmLineType] = { 0, 2, 3, 1, 1, 2, 3, 0 };
     line->start += skip[type];
-    trim_Rangecc(line);
+    if (normalize || (type >= heading1_GmLineType && type <= heading3_GmLineType)) {
+        trim_Rangecc(line);
+    }
 }
 
 static int lastVisibleRunBottom_GmDocument_(const iGmDocument *d) {
@@ -363,7 +365,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
                     d->size.x - indents[preformatted_GmLineType]) {
                     preFont = preformattedSmall_FontId;
                 }
-                trimLine_Rangecc_(&line, type);
+                trimLine_Rangecc_(&line, type, isNormalized);
                 preAltText = line;
                 /* TODO: store and link the alt text to this run */
                 continue;
@@ -375,9 +377,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
                     type = text_GmLineType;
                 }
             }
-            if (isNormalized) {
-                trimLine_Rangecc_(&line, type);
-            }
+            trimLine_Rangecc_(&line, type, isNormalized);
             run.font = fonts[type];
             /* Remember headings for the document outline. */
             if (type == heading1_GmLineType || type == heading2_GmLineType || type == heading3_GmLineType) {