From a263d67a5dfb5fad70059f63c1029f9174bf7ff0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 30 Apr 2018 21:05:13 -0400 Subject: link url matching - smid: sisu markup identify - inline_link_markup_regular matches series of marked up urls, e.g. { link txt }http://url, { link txt }http://url --- org/default_regex.org | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'org/default_regex.org') diff --git a/org/default_regex.org b/org/default_regex.org index e824577..5b759b0 100644 --- a/org/default_regex.org +++ b/org/default_regex.org @@ -225,7 +225,8 @@ static table_col_separator = ctRegex!(`┊`); static table_col_separator_nl = ctRegex!(`[┊]$`, "mg"); #+END_SRC -** inline markup footnotes endnotes :inline:footnote: +** inline markup :inline:footnote: +*** footnotes & endnotes #+name: meta_rgx #+BEGIN_SRC d @@ -255,12 +256,12 @@ static note_ref = ctRegex!(`^\S+?noteref_( #+name: meta_rgx #+BEGIN_SRC d -static inline_url_generic = ctRegex!(`(?:^|[}(\[ ])(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_#]`, "mg"); -static inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_]\S*)`, "mg"); -static inline_link_naked_url = ctRegex!(`(?P^|[ ])(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤)\S+?)(?P[.,;:?!'"]?(?:[ ]|$))`, "mg"); -static inline_link_markup_regular = ctRegex!(`(?P^|[ ])\{\s*(?P.+?)\s*\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P(?:[,;:? ]|[!.]?(?:[ ]|$)))`, "mg"); -static inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P[.,;:?!]?(?:[ ]|$))`, "mg"); -static inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg"); +static smid_inline_url_generic = ctRegex!(`(?:^|[}(\[ ])(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_#]`, "mg"); +static smid_inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_]\S*)`, "mg"); +static smid_inline_link_naked_url = ctRegex!(`(?P
^|[ ])(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤)\S+?)(?P[.,;:?!'"]?(?:[ ]|$))`, "mg"); // issue with #link #32
+static smid_inline_link_markup_regular                = ctRegex!(`(?P
^|[ ]|[^\S]?)\{\s*(?P.+?)\s*\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P[;:!,?.]?(?:[ )\]]|$))`, "mg"); // NEXT
+static smid_inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P[.,;:?!]?(?:[ ]|$))`, "mg");
+static smid_inline_link_endnote_url_helper            = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg");
 #+END_SRC
 
 *** images                                                         :images:
@@ -392,7 +393,7 @@ static template SiSUoutputRgxInit() {
 #+name: sp_ch_xhtml_rgx
 #+BEGIN_SRC d
 static xhtml_ampersand                            = ctRegex!(`[&]`);      // &
-static xhtml_quotation                            = ctRegex!(`[&]`);      // "
+static xhtml_quotation                            = ctRegex!(`["]`);      // "
 static xhtml_less_than                            = ctRegex!(`[<]`);      // <
 static xhtml_greater_than                         = ctRegex!(`[>]`);      // >
 static xhtml_line_break                           = ctRegex!(` [\\]{2}`); // 
-- cgit v1.2.3