aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/default_regex.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/default_regex.org')
-rw-r--r--org/default_regex.org26
1 files changed, 15 insertions, 11 deletions
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<co
#+name: meta_rgx
#+BEGIN_SRC d
static image = ctRegex!(`([a-zA-Z0-9._-]+?\.(?:png|gif|jpg))`, "mg");
+static smid_image = ctRegex!(`(?P<pre>(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*))(?P<image>\S+\.(?:png|gif|jpg))\s*(?P<post>(?:.+?)\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<pre>(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*))(?P<image>\S+\.(?:png|gif|jpg))\s+(?P<width>\d+)x(?P<height>\d+)\s*(?P<post>(?:.+?)\s*\}(?:image|(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[;:!,?.]?([ )\]]|$)))`, "mg");
-static smid_image = ctRegex!(`(?P<pre>(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*))(?P<image>\S+\.(?:png|gif|jpg))\s*(?P<post>(?:.+?)\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<pre>^|[ ]|[^\S]?)\{\s*(?P<text>.+?)\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!(`[&]`); // &amp;
-static xhtml_quotation = ctRegex!(`["]`); // &quot;
-static xhtml_less_than = ctRegex!(`[<]`); // &lt;
-static xhtml_greater_than = ctRegex!(`[>]`); // &gt;
-static xhtml_line_break = ctRegex!(` [\\]{2}`); // <br />
+static xhtml_ampersand = ctRegex!(`[&]`, "m"); // &amp;
+static xhtml_quotation = ctRegex!(`["]`, "m"); // &quot;
+static xhtml_less_than = ctRegex!(`[<]`, "m"); // &lt;
+static xhtml_greater_than = ctRegex!(`[>]`, "m"); // &gt;
+static xhtml_line_break = ctRegex!(` [\\]{2}`, "m"); // <br />
#+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<pre>┥)☼(?P<imginf>(?P<img>\S+?\.(?:jpg|gif|png)),w(?P<width>\d+)h(?P<height>\d+))\s*(?P<post>.*?┝┤.+?├)`, "mg");
-static inline_image_without_dimensions = ctRegex!(`(?P<pre>┥)☼(?P<imginf>(?P<img>\S+?\.(?:jpg|gif|png)),w(?P<width>0)h(?P<height>0))\s*(?P<post>.*?┝┤.+?├)`, "mg");
-static inline_link_anchor = ctRegex!(`┋(?P<anchor>\S+?)┋`, "mg");
+static inline_image = ctRegex!(`(?P<pre>┥)☼(?P<imginf>(?P<img>\S+?\.(?:jpg|gif|png)),w(?P<width>\d+)h(?P<height>\d+))\s*(?P<post>.*?┝┤.*?├)`, "mg");
+static inline_image_without_dimensions = ctRegex!(`(?P<pre>┥)☼(?P<imginf>(?P<img>\S+?\.(?:jpg|gif|png)),w(?P<width>0)h(?P<height>0))\s*(?P<post>.*?┝┤.*?├)`, "mg");
+static inline_link_anchor = ctRegex!(`┋(?P<anchor>\S+?)┋`, "mg"); // TODO *~text_link_anchor
+static inline_link_ = ctRegex!(`┥(?P<text>.+?)┝┤(?P<link>.+?)├`, "mg");
static inline_link = ctRegex!(`┥(?P<text>.+?)┝┤(?P<link>\S+?)├`, "mg");
+static inline_link_empty = ctRegex!(`┥(?P<text>.+?)┝┤├`, "mg");
+static inline_link_number = ctRegex!(`┥(?P<text>.+?)┝┤(?P<num>[0-9]+)├`, "mg"); // not used
static inline_link_number_only = ctRegex!(`(┥.+?┝)┤(?P<num>[0-9]+)├`, "mg");
static inline_link_stow_uri = ctRegex!(`┥(?P<text>.+?)┝┤(?P<link>[^ 0-9#┥┝┤├][^ 0-9┥┝┤├]+)├`, "mg"); // will not stow (stowed links) or object number internal links
static inline_link_hash = ctRegex!(`┥(?P<text>.+?)┝┤(?P<link>#(?P<segname>\S+?))├`, "mg");