From f6d28b62f0e02b8a88a1832589e203c7a613f45b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 25 Nov 2022 22:06:40 -0500 Subject: regex review, match speed & compile time, ctregex - improve match time - add interim fontface identifier marker - improve compile time - remove unused regexs - separate out some specialized output matches --- src/doc_reform/io_out/xmls.d | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/doc_reform/io_out/xmls.d') diff --git a/src/doc_reform/io_out/xmls.d b/src/doc_reform/io_out/xmls.d index 0b0dce7..131dbb6 100644 --- a/src/doc_reform/io_out/xmls.d +++ b/src/doc_reform/io_out/xmls.d @@ -57,12 +57,17 @@ template outputXHTMLs() { std.conv : to; import doc_reform.io_out, + doc_reform.io_out.rgx, + doc_reform.meta.rgx_files, + doc_reform.io_out.rgx_xhtml, doc_reform.io_out.create_zip_file, doc_reform.io_out.xmls, doc_reform.io_out.xmls_css; mixin spineRgxOut; + mixin spineRgxXHTML; struct outputXHTMLs { static auto rgx = RgxO(); + static auto rgx_xhtml = RgxXHTML(); @safe string div_delimit( string part, return ref string previous_part @@ -95,10 +100,10 @@ template outputXHTMLs() { } @safe string special_characters_text(string _txt) { _txt = _txt - .replaceAll(rgx.xhtml_ampersand, "&") // "&" - .replaceAll(rgx.xhtml_quotation, """) // """ - .replaceAll(rgx.xhtml_less_than, "<") // "<" - .replaceAll(rgx.xhtml_greater_than, ">") // ">" + .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
") @@ -161,7 +166,7 @@ template outputXHTMLs() { } if (!(obj.metainfo.is_a == "code")) { _txt = (_txt) - .replaceAll(rgx.xhtml_line_break, "
"); + .replaceAll(rgx_xhtml.line_break, "
"); } return _txt; } -- cgit v1.2.3