summaryrefslogtreecommitdiff
path: root/src/node.h
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-12-19 21:15:43 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-12-19 21:18:02 -0800
commitb0a6c472f881a3e0a7b61722fb6fddbcc39e5139 (patch)
tree511cc8147fef48a302128eae05af1ff37c21d092 /src/node.h
parent774ac507fc7e86c6fe0d7b16a3c1abaed4849fab (diff)
Changed API for CUSTOM_BLOCK and CUSTOM_INLINE.
Instead of using their `as.literal` content, we now give each custom node *two* literal fields, one to be printed on entering the node (before rendering the children, if any), the other on exiting (after rendering children). This gives us the flexibility to have custom nodes with children.
Diffstat (limited to 'src/node.h')
-rw-r--r--src/node.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node.h b/src/node.h
index 48d12df..cc93d23 100644
--- a/src/node.h
+++ b/src/node.h
@@ -42,6 +42,11 @@ typedef struct {
cmark_chunk title;
} cmark_link;
+typedef struct {
+ cmark_chunk on_enter;
+ cmark_chunk on_exit;
+} cmark_custom;
+
struct cmark_node {
struct cmark_node *next;
struct cmark_node *prev;
@@ -69,6 +74,7 @@ struct cmark_node {
cmark_code code;
cmark_header header;
cmark_link link;
+ cmark_custom custom;
int html_block_type;
} as;
};