(reference-core-blocks)= # Core block rules ```{rst-class} lead Block-level rules for CommonMark-style document structure. ``` --- ## AtxHeading `AtxHeading` parses hash-prefixed ATX headings from level 1 through level 6. ```markdown # Title ``` Output node is `Heading`, and its AST is: ```json { "type": "root", "children": [ { "type": "heading", "children": [ { "type": "text", "value": "Title" } ], "depth": 1 } ] } ``` Option example: use `AtxHeading(id_transform=True)` to add generated heading IDs. ```markdown # Hello World ``` ```json { "type": "root", "children": [ { "type": "heading", "data": { "id": "hello-world" }, "children": [ { "type": "text", "value": "Hello World" } ], "depth": 1 } ] } ``` ## SetextHeading `SetextHeading` parses paragraph continuations followed by `===` or `---` as level 1 or level 2 headings. ```markdown Title ----- ``` Output node is `Heading`, and its AST is: ```json { "type": "root", "children": [ { "type": "heading", "children": [ { "type": "text", "value": "Title" } ], "depth": 2 } ] } ``` Option example: use `SetextHeading(id_transform=True)` to add generated heading IDs. ```markdown Hello World =========== ``` ```json { "type": "root", "children": [ { "type": "heading", "data": { "id": "hello-world" }, "children": [ { "type": "text", "value": "Hello World" } ], "depth": 1 } ] } ``` ## ThematicBreak `ThematicBreak` parses horizontal rules made from `---`, `***`, or `___`. ```markdown --- ``` Output node is `ThematicBreak`, and its AST is: ```json { "type": "root", "children": [ { "type": "thematicBreak" } ] } ``` ## FencedCode `FencedCode` parses fenced code blocks opened by backtick or tilde fences. ````markdown ```python print(1) ``` ```` Output node is `Code`, and its AST is: ```json { "type": "root", "children": [ { "type": "code", "value": "print(1)\n", "lang": "python" } ] } ``` ## IndentedCode `IndentedCode` parses code blocks indented by four spaces or one tab. ```markdown print(1) ``` Output node is `Code`, and its AST is: ```json { "type": "root", "children": [ { "type": "code", "value": "print(1)\n" } ] } ``` ## HtmlBlock `HtmlBlock` parses CommonMark HTML block starts. ```markdown