diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-07 14:06:27 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-07 14:06:27 +0300 |
commit | 7fe41de315f8139f763be52fabbada0d7a69a551 (patch) | |
tree | 794a8b75cbe05b9d4924f09c025ad3e771959f74 /src | |
parent | 3f19321d81d785bb3e43389a29939b85c8debfb1 (diff) |
GmDocument: Trimming link labels with custom Emoji
Variation selectors should be skipped as well.
Diffstat (limited to 'src')
-rw-r--r-- | src/gmdocument.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index 2a31fe77..7ee7839e 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -163,6 +163,7 @@ static iInt2 measurePreformattedBlock_GmDocument_(const iGmDocument *d, const ch | |||
163 | } | 163 | } |
164 | 164 | ||
165 | static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *linkId) { | 165 | static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *linkId) { |
166 | /* Returns the human-readable label of the link. */ | ||
166 | static iRegExp *pattern_; | 167 | static iRegExp *pattern_; |
167 | if (!pattern_) { | 168 | if (!pattern_) { |
168 | pattern_ = new_RegExp("=>\\s*([^\\s]+)(\\s.*)?", caseInsensitive_RegExpOption); | 169 | pattern_ = new_RegExp("=>\\s*([^\\s]+)(\\s.*)?", caseInsensitive_RegExpOption); |
@@ -250,7 +251,7 @@ static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *li | |||
250 | link->flags |= iconFromLabel_GmLinkFlag; | 251 | link->flags |= iconFromLabel_GmLinkFlag; |
251 | link->labelIcon = (iRangecc){ desc.start, desc.start + len }; | 252 | link->labelIcon = (iRangecc){ desc.start, desc.start + len }; |
252 | line.start += len; | 253 | line.start += len; |
253 | line.start = skipSpace_CStr(line.start); | 254 | trimStart_Rangecc(&line); |
254 | // printf("custom icon: %x (%s)\n", icon, cstr_Rangecc(link->labelIcon)); | 255 | // printf("custom icon: %x (%s)\n", icon, cstr_Rangecc(link->labelIcon)); |
255 | // fflush(stdout); | 256 | // fflush(stdout); |
256 | } | 257 | } |