Skip to main content

Html

import { containsHtml, escapeHtml, stripHtmlTags } from '@rtorcato/js-common/html'

Exports

NameSummary
containsHtmlChecks if a string contains any HTML tags.
escapeHtmlEscapes special HTML characters in a string to prevent XSS attacks.
stripHtmlTagsStrips all HTML tags from a string.
textToHtmlConverts a plain text string to a simple HTML paragraph (\n to ).
unescapeHtmlUnescapes HTML entities in a string.