Skip to content

Commit 321aa1e

Browse files
committed
Add notes on implied sentences, ignored nodes
1 parent 321a38c commit 321aa1e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

readme.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,44 @@ Otherwise, inline MDAST nodes are wrapped when needed.
6666

6767
[`MDASTNode`][mdast].
6868

69+
##### Notes
70+
71+
###### Implied sentences
72+
73+
The algorithm supports implicit and explicit paragraphs, such as:
74+
75+
```html
76+
<article>
77+
An implicit sentence.
78+
<h1>An explicit sentence.</h1>
79+
</article>
80+
```
81+
82+
Yields:
83+
84+
```markdown
85+
An implicit sentence.
86+
87+
# An explicit sentence.
88+
```
89+
90+
###### Ignored nodes
91+
92+
Some nodes are ignored and their content will not be present in MDAST.
93+
To ignore custom elements, configure a handler for their tag-name or type that
94+
returns nothing.
95+
For example, to ignore `em` elements, pass `handlers: {'em': function () {}}`:
96+
97+
```html
98+
<p><strong>Importance</strong> and <em>emphasis</em>.</p>
99+
```
100+
101+
Yields:
102+
103+
```markdown
104+
**Importance** and .
105+
```
106+
69107
## Related
70108

71109
* [`mdast-util-to-hast`][mdast-util-to-hast]

0 commit comments

Comments
 (0)