diff options
Diffstat (limited to 'org/ao_abstract_doc_source.org')
-rw-r--r-- | org/ao_abstract_doc_source.org | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index d1bc79b..7c10dca 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -2821,30 +2821,15 @@ struct ObjInlineMarkupMunge { string[string] obj_txt; int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus; string obj_txt_out, tail, note; + auto rgx = Rgx(); + auto mkup = InlineMarkup(); private auto initialize_note_numbers() { n_foot = 0; n_foot_reg = 0; n_foot_sp_asterisk = 0; n_foot_sp_plus = 0; } - private auto object_notes_(string obj_txt_in) - in { } - body { - auto rgx = Rgx(); - auto mkup = InlineMarkup(); - obj_txt_out = ""; - tail = ""; - obj_txt_in = replaceAll( - obj_txt_in, - rgx.inline_notes_curly_sp_asterisk, - (mkup.en_a_o ~ "*" ~ " $1" ~ mkup.en_a_c) - ); - obj_txt_in = - replaceAll( - obj_txt_in, - rgx.inline_notes_curly_sp_plus, - (mkup.en_a_o ~ "+" ~ " $1" ~ mkup.en_a_c) - ); + string url_links(string obj_txt_in) { /+ url matched +/ if (auto m = matchAll(obj_txt_in, rgx.inline_url)) { /+ link: naked url: http://url +/ @@ -2887,6 +2872,9 @@ struct ObjInlineMarkupMunge { ); } } + return obj_txt_in; + } + string footnotes_endnotes(string obj_txt_in) { /+ endnotes (regular) +/ obj_txt_in = replaceAll( @@ -2916,6 +2904,30 @@ struct ObjInlineMarkupMunge { } else { obj_txt_out = obj_txt_in; } + return obj_txt_in; + } + private auto object_notes_(string obj_txt_in) + in { } + body { + obj_txt_out = ""; + tail = ""; + /+ special endnotes +/ + obj_txt_in = replaceAll( + obj_txt_in, + rgx.inline_notes_curly_sp_asterisk, + (mkup.en_a_o ~ "*" ~ " $1" ~ mkup.en_a_c) + ); + obj_txt_in = + replaceAll( + obj_txt_in, + 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)) { + obj_txt_in = url_links(obj_txt_in); + } + obj_txt_in = footnotes_endnotes(obj_txt_in); debug(footnotes) { writeln(obj_txt_out, tail); } |