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/meta_abstraction.org | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'org/meta_abstraction.org') diff --git a/org/meta_abstraction.org b/org/meta_abstraction.org index 5f058b7..27f83be 100644 --- a/org/meta_abstraction.org +++ b/org/meta_abstraction.org @@ -4759,11 +4759,11 @@ static struct ObjInlineMarkupMunge { obj_txt_in = obj_txt_in.replaceAll(rgx.inline_mono, (mng.mono ~ "{$1}" ~ mng.mono)); /+ url matched +/ obj_txt_in = obj_txt_in.replaceAll(rgx.inline_notes_al_special, ""); // TODO reinstate when special footnotes are implemented - if (obj_txt_in.match(rgx.inline_url_generic)) { + if (obj_txt_in.match(rgx.smid_inline_url_generic)) { /+ link: naked url: http://url +/ - if (obj_txt_in.match(rgx.inline_link_naked_url)) { + if (obj_txt_in.match(rgx.smid_inline_link_naked_url)) { obj_txt_in = (obj_txt_in).replaceAll( - rgx.inline_link_naked_url, + rgx.smid_inline_link_naked_url, ("$1" ~ mkup.lnk_o ~ "$2" ~ mkup.lnk_c ~ mkup.url_o ~ "$2" ~ mkup.url_c @@ -4775,10 +4775,10 @@ static struct ObjInlineMarkupMunge { maps to: { link which includes url as footnote }http://url~{ { http://url }http://url }~ +/ - if (obj_txt_in.match(rgx.inline_link_endnote_url_helper)) { + if (obj_txt_in.match(rgx.smid_inline_link_endnote_url_helper)) { obj_txt_in = (obj_txt_in) .replaceAll( - rgx.inline_link_endnote_url_helper_punctuated, + rgx.smid_inline_link_endnote_url_helper_punctuated, (mkup.lnk_o ~ "$1" ~ mkup.lnk_c ~ mkup.url_o ~ "$2" ~ mkup.url_c ~ "~{ " ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c @@ -4786,7 +4786,7 @@ static struct ObjInlineMarkupMunge { ~ " }~$3") // ("{ $1 }$2~{ { $2 }$2 }~$3") ) .replaceAll( - rgx.inline_link_endnote_url_helper, + rgx.smid_inline_link_endnote_url_helper, (mkup.lnk_o ~ "$1" ~ mkup.lnk_c ~ mkup.url_o ~ "$2" ~ mkup.url_c ~ "~{ " ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c @@ -4797,9 +4797,9 @@ static struct ObjInlineMarkupMunge { /+ link with regular markup: { linked text or image }http://url +/ - if (obj_txt_in.match(rgx.inline_link_markup_regular)) { + if (obj_txt_in.match(rgx.smid_inline_link_markup_regular)) { obj_txt_in = (obj_txt_in).replaceAll( - rgx.inline_link_markup_regular, + rgx.smid_inline_link_markup_regular, ("$1" ~ mkup.lnk_o ~ "$2" ~ mkup.lnk_c ~ mkup.url_o ~ "$3" ~ mkup.url_c @@ -4910,7 +4910,7 @@ static struct ObjInlineMarkupMunge { (mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c) ); /+ url matched +/ - if (obj_txt_in.match(rgx.inline_url)) { + if (obj_txt_in.match(rgx.smid_inline_url)) { urls = true; obj_txt_in = url_links(obj_txt_in); } @@ -5199,7 +5199,7 @@ static struct ObjInlineMarkup { obj_txt["munge"] = obj_[obj_key_].dup; obj_txt["munge"] = (obj_["is"].match(ctRegex!(`verse|code`))) ? obj_txt["munge"] - : strip(obj_txt["munge"]); + : obj_txt["munge"].strip; static __gshared string[] anchor_tags_ = []; auto x = munge.init; bool[string] obj_notes_and_links; @@ -5217,7 +5217,7 @@ static struct ObjInlineMarkup { } else if (obj_["lev"] == "1") { writeln("heading anchor tag missing: ", obj_txt["munge"]); } - x =munge.munge_heading(obj_txt["munge"], reset_note_numbers); + x = munge.munge_heading(obj_txt["munge"], reset_note_numbers); reset_note_numbers=false; goto default; case "para": @@ -5778,7 +5778,7 @@ struct ObjAttributes { } else if (auto m = obj_txt_in.matchFirst(rgx.para_indent_hang)) { _obj_attributes =" \"bullet\": \"false\"," ~ " \"indent_hang\": " ~ m.captures[1].to!string ~ "," - ~ " \"indent_base\": " ~ m.captures[2].to!string ~ ","; + ~ " \"indent_base\": " ~ m.captures[2].to!string ~ ","; } else if (auto m = obj_txt_in.matchFirst(rgx.para_indent)) { _obj_attributes =" \"bullet\": \"false\"," ~ " \"indent_hang\": " ~ m.captures[1].to!string ~ "," -- cgit v1.2.3