Skip to content

Instantly share code, notes, and snippets.

@cvle
Last active January 13, 2020 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cvle/67b69517b7d3e83f5de9ccace270415c to your computer and use it in GitHub Desktop.
Save cvle/67b69517b7d3e83f5de9ccace270415c to your computer and use it in GitHub Desktop.
Make Fluent work in IE11
// 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