How do I prevent node rearrangement? #177
-
So I'm using a SaaS app that uses a proprietary template language, one of the problems is I can't reuse fragments like say a breadcrumb template, like you could in other templating languages. So I'm using Pug to transpile but even it's pretty option doesn't clean up the markup enough. So I use I'm using rehype to clean up some white space in my html templates the problem is, rehype is rearranging tags it thinks are invalid markup and I can't figure out how to stop it. I tried enabling error reporting and the reporter plugin doesn't come back with anything. How do I get it to stop moving my nodes around? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
Can you please provide some more info? Share the actual input you have. The actual output you get. The expected output you want. The code you use to get there. The dependencies you have? |
Beta Was this translation helpful? Give feedback.
-
Thank you for the quick reply, I'll create a reproducer |
Beta Was this translation helpful? Give feedback.
That’s how html works. It does understand those tags. You can try it in a browser. It’s a very strong specification, which allows all kinds of things. One such things is that many tags are optional! The head opening for example. If you start with a div (or any unknown element, that cannot go in head, such as these), it’ll close the head and open the body for you