-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch cmark to allow nested documents
Patch taken from commonmark/cmark#522
- Loading branch information
1 parent
39f74ae
commit f7f8874
Showing
5 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
diff --git a/api_test/main.c b/api_test/main.c | ||
index c2db737..9bc5748 100644 | ||
--- a/api_test/main.c | ||
+++ b/api_test/main.c | ||
@@ -456,6 +456,7 @@ void hierarchy(test_batch_runner *runner) { | ||
|
||
int list_item_flag = 1 << CMARK_NODE_ITEM; | ||
int top_level_blocks = | ||
+ (1 << CMARK_NODE_DOCUMENT) | | ||
(1 << CMARK_NODE_BLOCK_QUOTE) | (1 << CMARK_NODE_LIST) | | ||
(1 << CMARK_NODE_CODE_BLOCK) | (1 << CMARK_NODE_HTML_BLOCK) | | ||
(1 << CMARK_NODE_PARAGRAPH) | (1 << CMARK_NODE_HEADING) | | ||
diff --git a/src/node.c b/src/node.c | ||
index c90b0d4..64a4ed7 100644 | ||
--- a/src/node.c | ||
+++ b/src/node.c | ||
@@ -39,10 +39,6 @@ static bool S_can_contain(cmark_node *node, cmark_node *child) { | ||
} | ||
} | ||
|
||
- if (child->type == CMARK_NODE_DOCUMENT) { | ||
- return false; | ||
- } | ||
- | ||
switch (node->type) { | ||
case CMARK_NODE_DOCUMENT: | ||
case CMARK_NODE_BLOCK_QUOTE: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters