From b0a6c472f881a3e0a7b61722fb6fddbcc39e5139 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 19 Dec 2015 21:15:43 -0800 Subject: 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. --- src/node.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/node.h') 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; }; -- cgit v1.2.3