From 61180130e90b43f057369878d2d53605f41f8374 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 26 Jun 2023 16:30:25 -0400 Subject: html links and metadata, fixes & cosmetic work --- src/doc_reform/io_out/html_snippet.d | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/doc_reform/io_out/html_snippet.d') diff --git a/src/doc_reform/io_out/html_snippet.d b/src/doc_reform/io_out/html_snippet.d index fea78a8..8dbb949 100644 --- a/src/doc_reform/io_out/html_snippet.d +++ b/src/doc_reform/io_out/html_snippet.d @@ -83,4 +83,20 @@ template htmlSnippet() { ); return html_blank_default; } + @safe string special_characters_text(string _txt) { + mixin spineRgxOut; + mixin spineRgxXHTML; + static auto rgx = RgxO(); + static auto rgx_xhtml = RgxXHTML(); + _txt = _txt + .replaceAll(rgx_xhtml.ampersand, "&") // "&" + .replaceAll(rgx_xhtml.quotation, """) // """ + .replaceAll(rgx_xhtml.less_than, "<") // "<" + .replaceAll(rgx_xhtml.greater_than, ">") // ">" + .replaceAll(rgx.br_line, "
") + .replaceAll(rgx.br_line_inline, "
") + .replaceAll(rgx.br_line_spaced, "
\n
") + .replaceAll(rgx.nbsp_char, " "); + return _txt; + } } -- cgit v1.2.3