summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-08 12:22:50 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-08 12:22:50 +0200
commit6f383d147fdcedd9626bfa3a80d4d5953eae398f (patch)
treed5e677d6481bd22ebcc49a14aaac88a456f127f0 /src
parent441064a8f07436386a4ac2cf688b66124356b2c9 (diff)
Gemtext markup was visible with Monospace Body
Diffstat (limited to 'src')
-rw-r--r--src/gmdocument.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index 3eda18d7..0d008181 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -122,10 +122,12 @@ static enum iGmLineType lineType_GmDocument_(const iGmDocument *d, const iRangec
122 return text_GmLineType; 122 return text_GmLineType;
123} 123}
124 124
125static void trimLine_Rangecc_(iRangecc *line, enum iGmLineType type) { 125static void trimLine_Rangecc_(iRangecc *line, enum iGmLineType type, iBool normalize) {
126 static const unsigned int skip[max_GmLineType] = { 0, 2, 3, 1, 1, 2, 3, 0 }; 126 static const unsigned int skip[max_GmLineType] = { 0, 2, 3, 1, 1, 2, 3, 0 };
127 line->start += skip[type]; 127 line->start += skip[type];
128 trim_Rangecc(line); 128 if (normalize || (type >= heading1_GmLineType && type <= heading3_GmLineType)) {
129 trim_Rangecc(line);
130 }
129} 131}
130 132
131static int lastVisibleRunBottom_GmDocument_(const iGmDocument *d) { 133static int lastVisibleRunBottom_GmDocument_(const iGmDocument *d) {
@@ -364,7 +366,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
364 d->size.x - indents[preformatted_GmLineType] * gap_Text) { 366 d->size.x - indents[preformatted_GmLineType] * gap_Text) {
365 preFont = preformattedSmall_FontId; 367 preFont = preformattedSmall_FontId;
366 } 368 }
367 trimLine_Rangecc_(&line, type); 369 trimLine_Rangecc_(&line, type, isNormalized);
368 preAltText = line; 370 preAltText = line;
369 /* TODO: store and link the alt text to this run */ 371 /* TODO: store and link the alt text to this run */
370 continue; 372 continue;
@@ -376,9 +378,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
376 type = text_GmLineType; 378 type = text_GmLineType;
377 } 379 }
378 } 380 }
379 if (isNormalized) { 381 trimLine_Rangecc_(&line, type, isNormalized);
380 trimLine_Rangecc_(&line, type);
381 }
382 run.font = fonts[type]; 382 run.font = fonts[type];
383 /* Remember headings for the document outline. */ 383 /* Remember headings for the document outline. */
384 if (type == heading1_GmLineType || type == heading2_GmLineType || type == heading3_GmLineType) { 384 if (type == heading1_GmLineType || type == heading2_GmLineType || type == heading3_GmLineType) {