Repository navigation
Document custom block and inline nodes in the C API - #664
Open
doomfrawen wants to merge 1 commit into
Open
doomfrawen wants to merge 1 commit into
doomfrawen wants to merge 1 commit into
Conversation
jgm
reviewed
Nov 25, 2026
Comment on lines
+32
to
+42
| * | ||
| * Only applications create `CMARK_NODE_CUSTOM_BLOCK` and | ||
| * `CMARK_NODE_CUSTOM_INLINE` nodes. A filter can create one | ||
| * with `cmark_node_new` and insert it into the syntax tree after parsing. | ||
| * A custom block can contain block or inline children. A custom inline | ||
| * can contain inline children. | ||
| * | ||
| * For example, to highlight the children of a custom inline in HTML, | ||
| * use `cmark_node_set_on_enter` for the opening `<mark>` tag and | ||
| * `cmark_node_set_on_exit` for the closing `</mark>` tag. The HTML | ||
| * renderer writes these strings literally before and after the children. |
Member
There was a problem hiding this comment.
I think it would be better to move this til after the definition. In this position one expects a preamble to the whole type definition, not an addendum-like comment about one particular node type.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #441
Explain who creates custom nodes, which children each type accepts, and how to wrap inline children in HTML using the enter and exit setters. The same example now appears in
cmark.hand the generatedcmark(3)manual.