Closed may17 closed 2 years ago
Same issue here, looks like the matcher returns { tag: 'content', attrs: {} }
, which fails, but { tag: 'content' }
seems to work. Spent a couple of hours digging, but not sure where the exact failure point is.
Hmm I think the recently-released posthtml-match-helper
(1.0.2
) might be what's causing it. Just tested with 1.0.1
and it all works as expected.
@phloe can you please check and let us know, I can also confirm I'm getting <content></content>
output as-is with the latest posthtml-match-helper
that posthtml-modules
depends on.
So this is where we try to replace the <content>
tag with what you pass into the module:
Given that this code above it works to match the tag:
... I wonder if that missing attribute is what's causing it.
Created #87 to get started with fixing this, though I'm not really sure how to go about it 🤔
I've updated the dependencies just in case, so we're working with current versions and are not running into any old bugs that may have been fixed. @Scrum if you could also have a look, please.
Locally, I've installed posthtml-matcher-helper@1.0.1
to bypass the issue whilst you're looking at it.
Yeah, that works as a workaround 👍
We'll need to get this fixed though as it's currently breaking for everyone and they might have no clue where it's coming from since there are no errors or anything...
The error is in posthtml-match-helper? Yikes.
The 1.0.2 bump was only supposed to have added TypeScript types...
Yeah, can't understand what's causing it but 1.0.1
does work fine 🤔
I hope it's fixed now with posthtml-match-helper@1.0.3
New bug was attrs
was always added to the match object:
match('content') // -> { tag: 'content', attrs: {} }
used to be
match('content') // -> { tag: 'content' }
failing to match tags with no attributes - but matching if they had any.
Also - empty attributes never worked (not a new bug - but fixed in 1.0.3):
match('content[]')
Thanks Rasmus, appreciate the fast response! Bumped it in #87 and tests are passing again 👍
Would you maybe consider adding some tests to posthtml-match-helper
so we minimize the risk of such issues? 🙏
YES! 😅
@may17 and @gavmck can you please confirm that 1.0.3
now works for you as well? Thanks!
@cossssmin Works for me on 1.0.3 ✅
Sorry for the delayed response. Works as expected now! Thx a lot.
Hi seems like that the content gets not rendered correctly? Maybe i did something wrong?
This is my module
I use my module like this:
The rendered result will be