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 --- org/out_odt.org | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'org/out_odt.org') diff --git a/org/out_odt.org b/org/out_odt.org index 23afc03..c9d36da 100644 --- a/org/out_odt.org +++ b/org/out_odt.org @@ -54,8 +54,10 @@ module doc_reform.io_out.odt; template formatODT() { <> mixin spineRgxOut; + mixin spineRgxXHTML; struct formatODT { static auto rgx = RgxO(); + static auto rgx_xhtml = RgxXHTML(); <> <> <> @@ -87,7 +89,9 @@ template outputODT() { <> mixin InternalMarkup; mixin spineRgxOut; + mixin spineRgxXHTML; static auto rgx = RgxO(); + static auto rgx_xhtml = RgxXHTML(); // mixin outputXmlODT; <> <> @@ -201,6 +205,7 @@ template outputODT() { #+BEGIN_SRC d @safe string _footnotes()(string _txt) { static auto rgx = RgxO(); + static auto rgx_xhtml = RgxXHTML(); _txt = _txt.replaceAll( rgx.inline_notes_al_regular_number_note, format(q"┃ @@ -394,10 +399,10 @@ template outputODT() { #+BEGIN_SRC d @safe string _special_characters(O)(string _txt, const O obj) { _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.nbsp_char, " "); return _txt; } @@ -1021,7 +1026,10 @@ void outputODT(D,I)( #+NAME: output_imports #+BEGIN_SRC d -import doc_reform.io_out; +import + doc_reform.io_out, + doc_reform.io_out.rgx, + doc_reform.io_out.rgx_xhtml; import std.digest.sha, std.file, -- cgit v1.2.3