Match all content apart certain tags #388
-
Something like with css Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I handle this with array filters, but I would like to know how to do this with posthtml. const contentWithoutDiv = content.filter(c => c.tag !== 'div'); |
Beta Was this translation helpful? Give feedback.
-
Yeah, |
Beta Was this translation helpful? Give feedback.
-
Thank You @cossssmin |
Beta Was this translation helpful? Give feedback.
Yeah,
:not
isn't supported as a matcher in PostHTML or posthtml-match-helper. Would be a nice thing to have in the latter so you could do something liketree.match(matchHelper(':not(div)'), node => { ... })