Last active
January 13, 2020 22:49
Make Fluent work in IE11
This file contains hidden or 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
// Wait for this to land: https://github.com/zloirock/core-js/pull/732 | |
// Then use this custom markup parser in <LocalizationProvider> as <template> doesn't work in IE11. | |
const parser = new DOMParser(); | |
function parseMarkup(str: string) { | |
const doc = parser.parseFromString(`<body>${str}</body>`, "text/html"); | |
return Array.from(doc.body.childNodes); | |
} | |
// Also don't forget to transpile fluent using babel to support IE11 :-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment