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 --- org/default_regex.org | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'org/default_regex.org') diff --git a/org/default_regex.org b/org/default_regex.org index 2af9ed2..170b74f 100644 --- a/org/default_regex.org +++ b/org/default_regex.org @@ -52,7 +52,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!(`^([^,]+)[ ]*,[ ]+(.+?)$`); @@ -280,10 +280,11 @@ static smid_inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(?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");
 #+END_SRC
 
 *** inline markup book index                             :inline:bookindex:
@@ -407,11 +408,11 @@ static template DocReformOutputRgxInit() {
 
 #+name: sp_ch_xhtml_rgx
 #+BEGIN_SRC d
-static xhtml_ampersand                            = ctRegex!(`[&]`);      // &
-static xhtml_quotation                            = ctRegex!(`["]`);      // "
-static xhtml_less_than                            = ctRegex!(`[<]`);      // <
-static xhtml_greater_than                         = ctRegex!(`[>]`);      // >
-static xhtml_line_break                           = ctRegex!(` [\\]{2}`); // 
+static xhtml_ampersand = ctRegex!(`[&]`, "m"); // & +static xhtml_quotation = ctRegex!(`["]`, "m"); // " +static xhtml_less_than = ctRegex!(`[<]`, "m"); // < +static xhtml_greater_than = ctRegex!(`[>]`, "m"); // > +static xhtml_line_break = ctRegex!(` [\\]{2}`, "m"); //
#+END_SRC * 2. ctRegex defaults shared by meta & output (generic) @@ -502,10 +503,13 @@ static inline_text_and_note_al_ = ctRegex!(`(.+?(?:【[*+] #+name: prgmkup_rgx #+BEGIN_SRC d /+ 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