diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2023-06-26 16:30:25 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2023-06-27 17:12:48 -0400 |
commit | 61180130e90b43f057369878d2d53605f41f8374 (patch) | |
tree | 96a5d8a33b69818b43c7d47d191cf17a4d797be5 /src/doc_reform/io_out/html_snippet.d | |
parent | replace some instances of dir listing, index.html (diff) |
html links and metadata, fixes & cosmetic work
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; + } } |