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

Add <template> support. #23

Closed
inikulin opened this issue Sep 18, 2014 · 8 comments
Closed

Add <template> support. #23

inikulin opened this issue Sep 18, 2014 · 8 comments

Comments

@inikulin
Copy link
Owner

At the time when parse5 was started templates were in draft. Since now they supported by all browsers except IE (surprise!) it's time to land them to parse5.

@inikulin
Copy link
Owner Author

@domenic You've asked for this. Currently I'm trying to assign tasks priority for all my projects. Do we need this for jsdom 1.0.0? Or it can be delayed for now?

@domenic
Copy link

domenic commented Oct 1, 2014

jsdom 1.0.0 is released!! :D

I would like this especially for people who want to parse arbitrary fragments, so we can tell them "put it in a <template> then use .content." Especially because jsdom's previous html parser used to not insert <html>, <body>, etc. so people got a false impression it was good at parsing fragments.

Also I think it'd be cool to close gaps with the HTML standard so parse5 can maintain its claim to fame as the most compliant parser on npm ;)

So, medium priority, but not urgent?

@inikulin
Copy link
Owner Author

inikulin commented Oct 1, 2014

@domenic Oh, I've missed the release, congratulations!
Regarding templates it's definitely makes sense to implement them, medium priority sounds reasonable. I'll try get my hands on it when I finish with escodegen rewrite (hope I will be done with it within a couple of weeks).

@dfreedm
Copy link

dfreedm commented Nov 3, 2014

+1, this is hitting a few people using vulcanize with <table> and <select>

@inikulin
Copy link
Owner Author

inikulin commented Nov 4, 2014

Templates are landed into the master branch. I will roll out a new version within a couple of days.

@inikulin inikulin closed this as completed Nov 4, 2014
@inikulin
Copy link
Owner Author

inikulin commented Nov 6, 2014

Ping @domenic, @Sebmaster. parse5 v1.2.0 with <template>-support is in npm (changelog).

@domenic
Copy link

domenic commented Nov 6, 2014

Sweeeet! :D We should add a note to jsdom README on how to use this to do fragment parsing.

@inikulin
Copy link
Owner Author

inikulin commented Nov 6, 2014

@azakus I've updated whacko as well (v0.17.2). Note that according to spec <template> content is wrapped into document fragment and can't be queried directly.

E.g.:

var $table = $('<table><template><tr></tr></template></table>');

console.log($table.find('tr').length); // Will print 0

var tmplContentNode = $table.find('template')[0].childNodes[0],
    $tmplContent = $(tmplContentNode);

console.log($tmplContent.find('tr').length); // Will print 1

inikulin added a commit that referenced this issue Apr 16, 2018
43081j pushed a commit to 43081j/parse5 that referenced this issue Dec 28, 2021
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.5.0 to 5.6.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.6.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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

No branches or pull requests

3 participants