MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / decodeHTML

Function decodeHTML

src/lib/util.js:89–97  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

87}
88
89function decodeHTML(html) {
90 return String(html)
91 .replace(/&/g, '&')
92 .replace(/&lt;/g, '<')
93 .replace(/&gt;/g, '>')
94 .replace(/&quot;/g, '"')
95 .replace(/&#039;/g, "\'")
96 .replace(/&#x2F;/g, '\/');
97}
98
99export function parseHTML(html) {
100 const htmlDoc = new DOMParser().parseFromString(html, 'text/html');

Callers 1

html2textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected