diff options
author | Ralph Amissah <ralph@amissah.com> | 2018-04-30 21:05:13 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:15 -0400 |
commit | a263d67a5dfb5fad70059f63c1029f9174bf7ff0 (patch) | |
tree | 01a42457dec1121bd8ed2c18f5ca01401e476292 /org/default_regex.org | |
parent | epub3, enable tables (diff) |
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
Diffstat (limited to 'org/default_regex.org')
-rw-r--r-- | org/default_regex.org | 17 |
1 files changed, 9 insertions, 8 deletions
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<before>^|[ ])(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤)\S+?)(?P<after>[.,;:?!'"]?(?:[ ]|$))`, "mg"); -static inline_link_markup_regular = ctRegex!(`(?P<before>^|[ ])\{\s*(?P<content>.+?)\s*\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P<after>(?:[,;:? ]|[!.]?(?:[ ]|$)))`, "mg"); -static inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P<content>.+?)\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P<after>[.,;:?!]?(?:[ ]|$))`, "mg"); -static inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(?P<content>.+?)\}(?P<link>(?:(?: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<pre>^|[ ])(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤)\S+?)(?P<post>[.,;:?!'"]?(?:[ ]|$))`, "mg"); // issue with #link #32 +static smid_inline_link_markup_regular = ctRegex!(`(?P<pre>^|[ ]|[^\S]?)\{\s*(?P<content>.+?)\s*\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P<post>[;:!,?.]?(?:[ )\]]|$))`, "mg"); // NEXT +static smid_inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P<content>.+?)\}(?P<link>(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P<after>[.,;:?!]?(?:[ ]|$))`, "mg"); +static smid_inline_link_endnote_url_helper = ctRegex!(`\{~\^\s+(?P<content>.+?)\}(?P<link>(?:(?: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}`); // <br /> |