Код: Выделить всё
"@types/sanitize-html": "^2.16.0",
"sanitize-html": "^2.17.0",
"@angular/core": "~19.2.0"
< /code>
code: < /p>
import sanitizeHtml, { IOptions } from 'sanitize-html';
export class Clipboard {
onPaste(range: Range, { text, html }: { text?: string; html?: string }): void {
html = html?.replace(``, '');
html = (html && sanitizeHtml(html, this.options as IOptions)) || html;
this.fn(range, { html, text });
}
}
< /code>
Когда я запускаю Angular с Vite, я получаю много предупреждений, подобных следующему: < /p>
Module "path" has been externalized for browser compatibility.
Cannot access "path.isAbsolute" in client code.
See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
Библиотека по-прежнему хорошо работает во время выполнения, но предупреждения заножа. способ подавить эти сообщения.
Подробнее здесь: https://stackoverflow.com/questions/797 ... ow-to-hide
Мобильная версия