diff options
author | Ralph Amissah <ralph@amissah.com> | 2016-11-15 10:51:45 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:13 -0400 |
commit | 47df905518ae9fb249f922c487cb7cd8c081f14b (patch) | |
tree | 5f9ef436292903d3dfb1a92535688c6b41445f54 /src/sdp/ao_abstract_doc_source.d | |
parent | complete toc section to include (existing) backmatter headings (diff) |
0.9.1 munge links & urls
* includes auto place url in endnote helper,
needs to occur before endnotes extracted
Diffstat (limited to 'src/sdp/ao_abstract_doc_source.d')
-rw-r--r-- | src/sdp/ao_abstract_doc_source.d | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d index 1677aed..f60fa60 100644 --- a/src/sdp/ao_abstract_doc_source.d +++ b/src/sdp/ao_abstract_doc_source.d @@ -525,6 +525,7 @@ template SiSUdocAbstraction() { } else if (to!int(an_object["lev_markup_number"]) < 4) { segment_object_belongs_to = ""; } + _anchor_tag=to!string(obj_cite_number); the_table_of_contents_section = obj_im.table_of_contents_gather_headings( an_object, dochead_make_aa, @@ -2345,6 +2346,49 @@ template SiSUdocAbstraction() { rgx.inline_notes_curly_sp_plus, (mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c) ); + /+ url matched +/ + if (auto m = matchAll(obj_txt_in, rgx.inline_url)) { + /+ link: naked url: http://url +/ + if (match(obj_txt_in, rgx.inline_link_naked_url)) { + obj_txt_in = + replaceAll( + obj_txt_in, + rgx.inline_link_naked_url, + ("$1" ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c ~ mkup.url_o ~ "$2" ~ mkup.url_c ~ "$3") // ("$1{ $2 }$2$3") + ); + } + /+ link with helper for endnote including the url: + {~^ link which includes url as footnote }http://url + maps to: + { link which includes url as footnote }http://url~{ { http://url }http://url }~ + +/ + if (match(obj_txt_in, rgx.inline_link_endnote_url_helper)) { + obj_txt_in = + replaceAll( + obj_txt_in, + rgx.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 ~ mkup.url_o ~ "$2" ~ mkup.url_c ~ " }~$3") // ("{ $1 }$2~{ { $2 }$2 }~$3") + ); + obj_txt_in = + replaceAll( + obj_txt_in, + rgx.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 ~ mkup.url_o ~ "$2" ~ mkup.url_c ~ " }~") // ("{ $1 }$2~{ { $2 }$2 }~") + ); + } + /+ link with regular markup: + { linked text or image }http://url + +/ + if (match(obj_txt_in, rgx.inline_link_markup_regular)) { + obj_txt_in = + replaceAll( + obj_txt_in, + rgx.inline_link_markup_regular, + ("$1" ~ mkup.lnk_o ~ " $2 " ~ mkup.lnk_c ~ mkup.url_o ~ "$3" ~ mkup.url_c ~ "$4") // ("$1{ $2 }$3$4") + ); + } + } + /+ endnotes (regular) +/ obj_txt_in = replaceAll( obj_txt_in, |