Skip to content
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

fix: Add doctype when parsing from string #301

Merged
merged 3 commits into from
Aug 26, 2021
Merged

fix: Add doctype when parsing from string #301

merged 3 commits into from
Aug 26, 2021

Conversation

karfau
Copy link
Member

@karfau karfau commented Aug 24, 2021

fixes #277

It's not the nicest solution, since the property should actually be readonly, but I think it's a good fix in the current situation.

@karfau karfau added this to the next release milestone Aug 24, 2021
@karfau karfau requested a review from brodybits August 24, 2021 20:57
const { parser } = getTestParser()
const doc = parser.parseFromString(
'<!DOCTYPE html><body></body>',
MIME_TYPE.HTML
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a random question if we should consider exporting these XML & HTML MIME types someday?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think it makes sense to publicly export the mime types and the name spaces.

Copy link
Member

@brodybits brodybits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple minor, optional nits

We should probably add some more blank lines to the code base ... someday.

test/parse/doctype.test.js Show resolved Hide resolved
test/parse/doctype.test.js Show resolved Hide resolved
Comment on lines +180 to 182
this.doc.doctype = dt;
}
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearly outside the scope of the proposed changes but we should probably add a blank line here someday.

karfau and others added 2 commits August 26, 2021 06:08
Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
@karfau karfau merged commit 566a8d4 into master Aug 26, 2021
@karfau karfau deleted the fix-add-doctype branch August 26, 2021 04:09
@karfau
Copy link
Member Author

karfau commented Aug 26, 2021

I merged from mobile device before the checks were done, one of the additional lines that was suggested was not OK for the linter. 64647d1 fixed that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

doctype is always null even when DocumentType is present as a child node
2 participants