summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gempub.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/gempub.c b/src/gempub.c
index e1f246ac..0f0345dc 100644
--- a/src/gempub.c
+++ b/src/gempub.c
@@ -85,13 +85,17 @@ static void parseNavigationLinks_Gempub_(const iGempub *d) {
85 init_RegExpMatch(&m); 85 init_RegExpMatch(&m);
86 if (matchRange_RegExp(linkPattern, line, &m)) { 86 if (matchRange_RegExp(linkPattern, line, &m)) {
87 iBeginCollect(); 87 iBeginCollect();
88 iGempubNavLink link;
89 init_GempubNavLink(&link);
90 const iRangecc url = capturedRange_RegExpMatch(&m, 1); 88 const iRangecc url = capturedRange_RegExpMatch(&m, 1);
91 set_String(&link.url, absoluteUrl_String(url_GmRequest(index), collectNewRange_String(url))); 89 iUrl parts;
92 setRange_String(&link.label, capturedRange_RegExpMatch(&m, 2)); 90 init_Url(&parts, collectNewRange_String(url));
93 trim_String(&link.label); 91 if (isEmpty_Range(&parts.scheme)) {
94 pushBack_Array(d->navLinks, &link); 92 iGempubNavLink link;
93 init_GempubNavLink(&link);
94 set_String(&link.url, absoluteUrl_String(url_GmRequest(index), collectNewRange_String(url)));
95 setRange_String(&link.label, capturedRange_RegExpMatch(&m, 2));
96 trim_String(&link.label);
97 pushBack_Array(d->navLinks, &link);
98 }
95 iEndCollect(); 99 iEndCollect();
96 } 100 }
97 } 101 }