-
Notifications
You must be signed in to change notification settings - Fork 19
html-to-hast doesn't respect self-closing esi tags #317
Comments
@davidnuescheler for now, don't use self-closing esi tags outside attributes. |
@tripodsan do you know if this is a parsing problem or a serialization problem? |
After looking into this a bit, I'd say it is behaving as specified: In HTML5, there are no self-closing tags ( So, I'm going to mark this as In short: don't use self-closing ESI tags. I'm also tagging this |
we could also ensure that all self-closing |
|
?? nodesi has no play in this. I mean, we could just do:
|
I know that we don't use |
We need to pre-process the ESI tags so that they play nicely with a standard HTML parser, which does not recognize self-closing tags. Instead of rolling our own regex-based ESI parser, we'd like to use `nodesi`. Therefore this change renames `findESIInclueTags` to `findESIIncludeTags` and exposes it as part of the `ESI` API. see adobe/helix-pipeline#317
I wouldn't call it a parser...more like a good finder: besides, fastly certainly doesn't use nodeesi.... |
A good finder is better than a great regex, especially when it offers some consistency with the rest of the stack. (we can't get all of the stack, of course – unless we compile Varnish's ESI module to webm) |
Just for the record: I don't think this classified as invalid, since the esi-lang especially states that the tag is empty: https://www.w3.org/TR/esi-lang
|
We need to pre-process the ESI tags so that they play nicely with a standard HTML parser, which does not recognize self-closing tags. Instead of rolling our own regex-based ESI parser, we'd like to use `nodesi`. Therefore this change renames `findESIInclueTags` to `findESIIncludeTags` and exposes it as part of the `ESI` API. see adobe/helix-pipeline#317
this is no longer relevant, as it is now supported with the new jsdom/htlengine #337 the tags are now automatically closed:
|
html with self closing esi tags are wrongly parsed by html-to-hast.
eg:
is turned into
The text was updated successfully, but these errors were encountered: