HTML → text keeps reading order without a browser: block elements become line breaks, paragraphs and headings get blank lines, lists become - / 1. markers with nesting, table cells are tab-separated, links become "text (url)", images become [alt], entities are decoded and script/style/head/template/svg/iframe subtrees are dropped; <pre> whitespace is preserved. Text → HTML escapes everything, wraps paragraphs in <p> with <br> for single line breaks, turns - / 1. lines into lists and optionally autolinks http(s) URLs with rel="noopener noreferrer". Everything runs locally; the HTML is never rendered.
inline appends the URL after the link text.