aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/io_out/html_snippet.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2023-06-26 16:30:25 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2023-06-27 17:12:48 -0400
commit61180130e90b43f057369878d2d53605f41f8374 (patch)
tree96a5d8a33b69818b43c7d47d191cf17a4d797be5 /src/doc_reform/io_out/html_snippet.d
parentreplace 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.d16
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, "&amp;") // "&#38;"
+ .replaceAll(rgx_xhtml.quotation, "&quot;") // "&#34;"
+ .replaceAll(rgx_xhtml.less_than, "&lt;") // "&#60;"
+ .replaceAll(rgx_xhtml.greater_than, "&gt;") // "&#62;"
+ .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;
+ }
}