You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
336 B

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. import text from "./text";
  2. function parser(type) {
  3. return function(input, init) {
  4. return text(input, init).then(function(text) {
  5. return (new DOMParser).parseFromString(text, type);
  6. });
  7. };
  8. }
  9. export default parser("application/xml");
  10. export var html = parser("text/html");
  11. export var svg = parser("image/svg+xml");