diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-07-02 08:57:18 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-07-02 08:57:18 +0300 |
commit | 40683c227f4878331855291b487d44e51e69276f (patch) | |
tree | 1437c4c7e96111596644fc272346a53bf521e615 | |
parent | 07489bf73f99d7accae4313a8c85a3b94e31a180 (diff) |
Gopher: Adjusted indents
-rw-r--r-- | src/gmdocument.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index c298f75b..ec0bddb5 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -181,7 +181,7 @@ static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *li | |||
181 | iGmLink *link = new_GmLink(); | 181 | iGmLink *link = new_GmLink(); |
182 | link->urlRange = capturedRange_RegExpMatch(&m, 1); | 182 | link->urlRange = capturedRange_RegExpMatch(&m, 1); |
183 | setRange_String(&link->url, link->urlRange); | 183 | setRange_String(&link->url, link->urlRange); |
184 | set_String(&link->url, canonicalUrl_String(absoluteUrl_String(&d->url, &link->url))); | 184 | set_String(&link->url, canonicalUrl_String(absoluteUrl_String(&d->url, &link->url))); |
185 | /* Check the URL. */ { | 185 | /* Check the URL. */ { |
186 | iUrl parts; | 186 | iUrl parts; |
187 | init_Url(&parts, &link->url); | 187 | init_Url(&parts, &link->url); |
@@ -409,6 +409,9 @@ static void doLayout_GmDocument_(iGmDocument *d) { | |||
409 | indents[bullet_GmLineType] -= 5; | 409 | indents[bullet_GmLineType] -= 5; |
410 | indents[preformatted_GmLineType] -= 5; | 410 | indents[preformatted_GmLineType] -= 5; |
411 | } | 411 | } |
412 | if (isGopher) { | ||
413 | indents[preformatted_GmLineType] = indents[text_GmLineType]; | ||
414 | } | ||
412 | static const float topMargin[max_GmLineType] = { | 415 | static const float topMargin[max_GmLineType] = { |
413 | 0.0f, 0.333f, 1.0f, 0.5f, 2.0f, 1.5f, 1.25f, 0.25f | 416 | 0.0f, 0.333f, 1.0f, 0.5f, 2.0f, 1.5f, 1.25f, 0.25f |
414 | }; | 417 | }; |
@@ -569,6 +572,10 @@ static void doLayout_GmDocument_(iGmDocument *d) { | |||
569 | if (type != preformatted_GmLineType || prevType != preformatted_GmLineType) { | 572 | if (type != preformatted_GmLineType || prevType != preformatted_GmLineType) { |
570 | enableIndents = iTrue; | 573 | enableIndents = iTrue; |
571 | } | 574 | } |
575 | /* Gopher: Always indent preformatted blocks. */ | ||
576 | if (isGopher && type == preformatted_GmLineType) { | ||
577 | enableIndents = iTrue; | ||
578 | } | ||
572 | if (!enableIndents) { | 579 | if (!enableIndents) { |
573 | indent = 0; | 580 | indent = 0; |
574 | } | 581 | } |