File tree Expand file tree Collapse file tree 5 files changed +26
-3
lines changed Expand file tree Collapse file tree 5 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,14 @@ var own = {}.hasOwnProperty;
99function one ( h , node , parent ) {
1010 var fn = null ;
1111
12- if ( node . type === 'element' && own . call ( h . handlers , node . tagName ) ) {
13- fn = h . handlers [ node . tagName ] ;
12+ if ( node . type === 'element' ) {
13+ if ( node . properties && node . properties . dataMdast === 'ignore' ) {
14+ return ;
15+ }
16+
17+ if ( own . call ( h . handlers , node . tagName ) ) {
18+ fn = h . handlers [ node . tagName ] ;
19+ }
1420 } else if ( own . call ( h . handlers , node . type ) ) {
1521 fn = h . handlers [ node . type ] ;
1622 }
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ An implicit sentence.
8787# An explicit sentence.
8888```
8989
90- ###### Ignored nodes
90+ ###### Ignoring nodes
9191
9292Some nodes are ignored and their content will not be present in MDAST.
9393To ignore custom elements, configure a handler for their tag-name or type that
@@ -104,6 +104,18 @@ Yields:
104104**Importance** and .
105105```
106106
107+ To ignore a specific element from HTML, set ` data-mdast ` to ` ignore ` :
108+
109+ ``` html
110+ <p ><strong >Importance</strong > and <em data-mdast =" ignore" >emphasis</em >.</p >
111+ ```
112+
113+ Yields:
114+
115+ ``` markdown
116+ **Importance** and .
117+ ```
118+
107119## Related
108120
109121* [ ` mdast-util-to-hast ` ] [ mdast-util-to-hast ]
Original file line number Diff line number Diff line change 1+ < p > < strong > Importance</ strong > and < em data-mdast ="ignore "> emphasis</ em > .</ p >
Original file line number Diff line number Diff line change 1+ {
2+ "fragment" : true
3+ }
Original file line number Diff line number Diff line change 1+ ** Importance** and .
You can’t perform that action at this time.
0 commit comments