summaryrefslogtreecommitdiff
path: root/src/latex.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2020-01-19 13:46:10 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2020-01-23 08:25:54 -0800
commitf3f50b29d615d2678d8047dc277b108cc5143167 (patch)
treeca3f01f6352d2cc2dd7cfc9c96508b800b8cc510 /src/latex.c
parent3ef0718f9f4c9dea5014a8a0e9a67e2366b9374f (diff)
Rearrange struct cmark_node
Introduce multi-purpose data/len members in struct cmark_node. This is mainly used to store literal text for inlines, code and HTML blocks. Move the content strbuf for blocks from cmark_node to cmark_parser. When finalizing nodes that allow inlines (paragraphs and headings), detach the strbuf and store the block content in the node's data/len members. Free the block content after processing inlines. Reduces size of struct cmark_node by 8 bytes.
Diffstat (limited to 'src/latex.c')
-rw-r--r--src/latex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/latex.c b/src/latex.c
index 0d9517d..1d4d7bc 100644
--- a/src/latex.c
+++ b/src/latex.c
@@ -190,9 +190,9 @@ static link_type get_link_type(cmark_node *node) {
realurllen -= 7;
isemail = true;
}
- if (realurllen == link_text->as.literal.len &&
- strncmp(realurl, (char *)link_text->as.literal.data,
- link_text->as.literal.len) == 0) {
+ if (realurllen == link_text->len &&
+ strncmp(realurl, (char *)link_text->data,
+ link_text->len) == 0) {
if (isemail) {
return EMAIL_AUTOLINK;
} else {