diff options
Diffstat (limited to 'src/doc_reform/io_out/html_snippet.d')
-rw-r--r-- | src/doc_reform/io_out/html_snippet.d | 16 |
1 files changed, 16 insertions, 0 deletions
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, "<br />") + .replaceAll(rgx.br_line_inline, "<br />") + .replaceAll(rgx.br_line_spaced, "<br />\n<br />") + .replaceAll(rgx.nbsp_char, " "); + return _txt; + } } |