Мне нужен какой-то способ сохранить теги внутри кода или предварительного блока при очистке.
Например:
<a href="http://sanitize.com">link</a>
<code>
<a href="http://donotsanitize.com">link</a>
<p>The link above and this p should not be sanitized, just converted to html special chars.</p>
</code>
Должен вывести что-то вроде:
link
<code>
<a href="http://donotsanitize.com">link</a>
<p>The link above and this p should not be sanitized, just converted to html special chars.</p>
</code>
При обычных / обычных методах очистки вывод:
link
<code>
link
The link above and this p should not be sanitized, just converted to html special chars.
</code>