enum Cmark::NodeType
Overview
Represents the type of a node.
If valid, the type can be grouped into several categories:
- block or inline; 2) Commonmark or GFM; and 3) container or leaf. Use the respective method to check the node type category:
#block?
or#inline?
#commonmark?
or#gfm?
#container?
or#leaf?
If the node is invalid it has the type None
, and all of the previous methods will return false.
Commonmark:
- Block types:
- Inline types:
GFM:
- Block types:
- Inline types:
Leaf nodes:
NOTE The GFM syntax extension for tasklists does not create a new node type. That is, a tasklist item
has NodeType::Item
. To check if a given node is a tasklist item use Node#tasklist_item?
; to set if a
list item node represents a tasklist or not use Node#tasklist_item=
.
NOTE Both footnote elements are part of GFM, but they are not syntax extensions and they
are not defined in the GFM spec.
Therefore, they can be enabled in so-called Commonmark-only methods using Option::Footnotes
.
Normal inconsistencies when trying to define a standard specification‽
For more information regarding footnotes in cmark-gfm see this pull request.
To check if an element is part of a syntax extension use #syntax_extension?
.
NOTE The numeric values of GFM extensions types do not correspond to their counterpart in the C library because these are not predefined constants, they are dynamically registered at runtime.
Defined in:
cmark/node_type.crEnum Members
-
None =
0
-
Invalid node
-
Document =
32769
-
Commonmark / Block / Container
-
BlockQuote =
32770
-
Commonmark / Block / Container
-
List =
32771
-
Commonmark / Block / Container
-
Item =
32772
-
Commonmark / Block / Container
-
CodeBlock =
32773
-
Commonmark / Block / Leaf
-
HTMLBlock =
32774
-
Commonmark / Block / Container
-
CustomBlock =
32775
-
Commonmark / Block / Container
-
Paragraph =
32776
-
Commonmark / Block / Container
-
Heading =
32777
-
Commonmark / Block / Container
-
ThematicBreak =
32778
-
Commonmark / Block / Leaf
-
FootnoteDefinition =
32779
-
GFM / Block / Container
-
Text =
49153
-
Commonmark / Inline / Leaf
-
Softbreak =
49154
-
Commonmark / Inline / Leaf
-
Linebreak =
49155
-
Commonmark / Inline / Leaf
-
Code =
49156
-
Commonmark / Inline / Leaf
-
HTMLInline =
49157
-
Commonmark / Inline / Leaf
-
CustomInline =
49158
-
Commonmark / Inline / Container
-
Emph =
49159
-
Commonmark / Inline / Container
-
Strong =
49160
-
Commonmark / Inline / Container
-
Link =
49161
-
Commonmark / Inline / Container
-
Image =
49162
-
Commonmark / Inline / Container
-
FootnoteReference =
49163
-
GFM / Inline / Container
-
Table =
32785
-
GFM / Block / Container
-
TableRow =
32786
-
GFM / Block / Container
-
TableCell =
32787
-
GFM / Block / Container
-
Strikethrough =
49169
-
GFM / Inline / Container
Instance Method Summary
- #block?
- #block_quote?
- #code?
- #code_block?
- #commonmark?
- #container?
- #custom_block?
- #custom_inline?
- #document?
- #emph?
- #footnote_definition?
- #footnote_reference?
- #gfm?
- #heading?
- #html_block?
- #html_inline?
- #image?
- #inline?
- #item?
- #leaf?
- #linebreak?
- #link?
- #list?
- #none?
- #paragraph?
- #softbreak?
- #strikethrough?
- #strong?
- #syntax_extension?
- #table?
- #table_cell?
- #table_row?
- #text?
- #thematic_break?