(html)
| 71 | }; |
| 72 | |
| 73 | const sanitizeRenderedHtml = (html) => |
| 74 | String(html).replace( |
| 75 | URL_ATTRIBUTE_PATTERN, |
| 76 | (match, attributeName, doubleQuoted, singleQuoted, unquoted) => { |
| 77 | const value = doubleQuoted ?? singleQuoted ?? unquoted ?? ""; |
| 78 | if (isSafeUrl(value, attributeName)) return match; |
| 79 | return ` ${attributeName.toLowerCase()}="#"`; |
| 80 | }, |
| 81 | ); |
| 82 | |
| 83 | marked.setOptions({ |
| 84 | gfm: true, |
no test coverage detected