File size: 350 Bytes
1e92f2d
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
export default (html: string) => {
  if (typeof DOMParser === 'undefined') {
    throw new Error(
      'The native `DOMParser` global which the `Html` serializer uses by default is not present in this environment. You must supply the `options.parseHtml` function instead.'
    );
  }

  return new DOMParser().parseFromString(html, 'text/html');
};