From 54c662aed1b2b004aeffe3d250a9dbd705897bb4 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 11 Feb 2019 16:34:54 -0500 Subject: metaverse single line munging tuning --- src/doc_reform/meta/rgx.d | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/doc_reform/meta/rgx.d') diff --git a/src/doc_reform/meta/rgx.d b/src/doc_reform/meta/rgx.d index 7dd4a89..f875ce3 100644 --- a/src/doc_reform/meta/rgx.d +++ b/src/doc_reform/meta/rgx.d @@ -9,7 +9,7 @@ static template DocReformRgxInit() { static true_dollar = ctRegex!(`\$`, "gm"); static flag_action = ctRegex!(`^(--[a-z][a-z0-9-]+)$`); static flag_action_str = ctRegex!(` (--[a-z][a-z0-9-]+)`); - static within_quotes = ctRegex!(`"(.+?)"`); + static within_quotes = ctRegex!(`"(.+?)"`, "m"); static make_heading_delimiter = ctRegex!(`[;][ ]*`); static arr_delimiter = ctRegex!(`[ ]*[;][ ]*`); static name_delimiter = ctRegex!(`^([^,]+)[ ]*,[ ]+(.+?)$`); @@ -155,10 +155,11 @@ static template DocReformRgxInit() { static smid_inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[.,;:?!]?([ ]|$))`, "mg"); static smid_inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg"); static image = ctRegex!(`([a-zA-Z0-9._-]+?\.(?:png|gif|jpg))`, "mg"); + static smid_image = ctRegex!(`(?P
(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*))(?P\S+\.(?:png|gif|jpg))\s*(?P(?:.+?)\s*\}(?:image|(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[;:!,?.]?([ )\]]|$)))`, "mg");
     static smid_image_generic                              = ctRegex!(`(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*)\S+\.(?:png|gif|jpg).+?\}(?:image|(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[;:!,?.]?([ )\]]|$))`, "mg");
     static smid_image_with_dimensions                      = ctRegex!(`(?P
(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*))(?P\S+\.(?:png|gif|jpg))\s+(?P\d+)x(?P\d+)\s*(?P(?:.+?)\s*\}(?:image|(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[;:!,?.]?([ )\]]|$)))`, "mg");
-    static smid_image                                      = ctRegex!(`(?P
(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*))(?P\S+\.(?:png|gif|jpg))\s*(?P(?:.+?)\s*\}(?:image|(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[;:!,?.]?([ )\]]|$)))`, "mg");
-    static smid_mod_image_without_dimensions               = ctRegex!(`\{(?:~\^\s+|\s*)☼\S+\.(?:png|gif|jpg),w0h0\s+(?:.+?)\s*\}(?:image|(?:https?|git):\/\/\S+?)(?=[;:!,?.]?([ )\]]|$))`, "mg");
+    static smid_image_delimit                              = ctRegex!(`(?P
^|[ ]|[^\S]?)\{\s*(?P.+?)\s*\}(?:image)(?=[;:!,?.]?([ )\]]|$))`, "mg");
+    static smid_mod_image_without_dimensions               = ctRegex!(`[{┥](?:~\^\s+|\s*)☼\S+\.(?:png|gif|jpg),w0h0\s+(?:.+?)\s*[}┝](?:image|(?:https?|git):\/\/\S+?)(?=[;:!,?.]?([ )\]]|$))`, "mg");
     /+ inline markup book index +/
     static book_index                                     = ctRegex!(`^=\{\s*(.+?)\}$`, "m");
     static book_index_open                                = ctRegex!(`^=\{\s*([^}]+?)$`);
@@ -254,10 +255,13 @@ static template DocReformRgxInit() {
     static inline_text_and_note_al                        = ctRegex!(`(?P.+?)【(?:[*+ ]*)(?P.+?)】`, "mg");
     static inline_text_and_note_al_                       = ctRegex!(`(.+?(?:【[*+]*\s+.+?】|$))`, "mg");
     /+ inline markup footnotes endnotes +/
-    static inline_image                                   = ctRegex!(`(?P
┥)☼(?P(?P\S+?\.(?:jpg|gif|png)),w(?P\d+)h(?P\d+))\s*(?P.*?┝┤.+?├)`, "mg");
-    static inline_image_without_dimensions                = ctRegex!(`(?P
┥)☼(?P(?P\S+?\.(?:jpg|gif|png)),w(?P0)h(?P0))\s*(?P.*?┝┤.+?├)`, "mg");
-    static inline_link_anchor                             = ctRegex!(`┋(?P\S+?)┋`, "mg");
+    static inline_image                                   = ctRegex!(`(?P
┥)☼(?P(?P\S+?\.(?:jpg|gif|png)),w(?P\d+)h(?P\d+))\s*(?P.*?┝┤.*?├)`, "mg");
+    static inline_image_without_dimensions                = ctRegex!(`(?P
┥)☼(?P(?P\S+?\.(?:jpg|gif|png)),w(?P0)h(?P0))\s*(?P.*?┝┤.*?├)`, "mg");
+    static inline_link_anchor                             = ctRegex!(`┋(?P\S+?)┋`, "mg"); // TODO *~text_link_anchor
+    static inline_link_                                   = ctRegex!(`┥(?P.+?)┝┤(?P.+?)├`, "mg");
     static inline_link                                    = ctRegex!(`┥(?P.+?)┝┤(?P\S+?)├`, "mg");
+    static inline_link_empty                              = ctRegex!(`┥(?P.+?)┝┤├`, "mg");
+    static inline_link_number                             = ctRegex!(`┥(?P.+?)┝┤(?P[0-9]+)├`, "mg"); // not used
     static inline_link_number_only                        = ctRegex!(`(┥.+?┝)┤(?P[0-9]+)├`, "mg");
     static inline_link_stow_uri                           = ctRegex!(`┥(?P.+?)┝┤(?P[^ 0-9#┥┝┤├][^ 0-9┥┝┤├]+)├`, "mg"); // will not stow (stowed links) or object number internal links
     static inline_link_hash                               = ctRegex!(`┥(?P.+?)┝┤(?P#(?P\S+?))├`, "mg");
-- 
cgit v1.2.3