import escapeHtml from "./escape_html";
/**
* @example
* linebreaksbr(`This string's "full" of characters that need to be escaped in HTML.\n& it also has a line break!`);
* // Returns 'This string's "full" of <i>characters</i> that need to be escaped in HTML.
\n& it also has a line break!'
*/
export default function linebreaksbr(str: string): string {
return escapeHtml(str).replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, "$1
$2");
}