aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/ao_abstract_doc_source.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-11-16 10:08:35 -0500
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:13 -0400
commitb7f2764f5e5eb0f3e9fad8e76272756f4219241b (patch)
tree427ca61cb744f36282e09967c437610dbc2b6cc4 /src/sdp/ao_abstract_doc_source.d
parent0.9.1 munge links & urls (diff)
minor reorganise same
Diffstat (limited to 'src/sdp/ao_abstract_doc_source.d')
-rw-r--r--src/sdp/ao_abstract_doc_source.d48
1 files changed, 30 insertions, 18 deletions
diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d
index f60fa60..851d375 100644
--- a/src/sdp/ao_abstract_doc_source.d
+++ b/src/sdp/ao_abstract_doc_source.d
@@ -2322,30 +2322,15 @@ template SiSUdocAbstraction() {
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 +/
@@ -2388,6 +2373,9 @@ template SiSUdocAbstraction() {
);
}
}
+ return obj_txt_in;
+ }
+ string footnotes_endnotes(string obj_txt_in) {
/+ endnotes (regular) +/
obj_txt_in =
replaceAll(
@@ -2417,6 +2405,30 @@ template SiSUdocAbstraction() {
} 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);
}