-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preprocessing into AST doesn't work with <!DOCTYPE> tags #870
Comments
FWIW, tildeio/simple-html-tokenizer#71 is working on fixing this. |
This appears fixed by #1305. I did confirm by adding the above example into a local test, which passed. |
I don't think this has been fixed. > require('@glimmer/syntax').preprocess('<!DOCTYPE html>')
{
type: 'Template',
body: [],
blockParams: [],
loc: SourceSpan {
data: HbsSpan {
source: [Source],
hbsPositions: [Object],
kind: 'HbsPosition',
_charPosSpan: null,
_providedHbsLoc: [Object]
},
isInvisible: false
}
}
> require('@glimmer/syntax').print(require('@glimmer/syntax').preprocess('<!DOCTYPE html><div/>'))
'<div />' |
Any updates on this? This is quite a pain, and causes issues in projects such as Prettier. |
I think it's worth supporting, but personally, i'm waiting until @wycats pr here: https://github.com/glimmerjs/glimmer-vm/pull/1428/files#diff-40f60e1037245d7b8a98a7325d53890a717da9979adeb54a61a795c4ba07f9c9 Is dealt with. Too many changes. |
Hello!
Running a template with doctype tags (such as
<!DOCTYPE html>
) appears to cause preprocessing the template into an AST to break.Example:
run through...
becomes...
and the AST looks like: https://gist.github.com/zimmi88/645a444f37066a58f25384713b7af822
I've tracked this to the doctype specifically because when I transform the first line into an HTML comment or remove it entirely, the output matches the input as expected.
Glimmer shouldn't usually come across doctype declarations, but supporting this might be useful for a couple of reasons...
index.html
that ships with Ember CLI apps.I hope this helps! Let me know if you need any additional details or information.
The text was updated successfully, but these errors were encountered: