This repository has been archived by the owner on Feb 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(resource_url_resolver): IE/Safari compatible HTML parsing
On Internet Explorer (e.g. IE10 on Win7), the following weird bug occurs with template elements. FYI, IE does not support template element, but this bug appears to only hit template elements and but not other unknown elements. var doc = new DOMParser().parseFromString("<!doctype html><html><body><template>CONTENTS</template></body></html>", "text/html"); // Prints "<template>CONTENTS</template>" as expected. console.log(doc.body.innerHTML); // This should be a no-op. doc.body.querySelectorAll("div"); // Prints "<template></template>" - completely losing "CONTENTS". console.log(doc.body.innerHTML); This commit uses an alternate parsing method compatible with supported browsers, and also fixes a RegExp for IE compatibility.
- Loading branch information
Showing
3 changed files
with
81 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters