aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/ocda_functions.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/ocda_functions.org')
-rw-r--r--org/ocda_functions.org39
1 files changed, 35 insertions, 4 deletions
diff --git a/org/ocda_functions.org b/org/ocda_functions.org
index a5b60fa..da8e5ee 100644
--- a/org/ocda_functions.org
+++ b/org/ocda_functions.org
@@ -2528,7 +2528,7 @@ ObjGenericComposite set_object_generic()(
// ↓ - object inline munge
static struct ObjInlineMarkupMunge {
string[string] obj_txt;
- int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus;
+ int n_foot, n_foot_reg, n_foot_sp_asterisk, n_foot_sp_plus, n_foot_ed_asterisk, n_foot_ed_plus;
string asterisks_, plus_;
string obj_txt_out, tail, note;
static auto rgx = RgxI();
@@ -2539,6 +2539,8 @@ static struct ObjInlineMarkupMunge {
n_foot_reg = 0;
n_foot_sp_asterisk = 0;
n_foot_sp_plus = 0;
+ n_foot_ed_asterisk = 0;
+ n_foot_ed_plus = 0;
}
static auto images()(string obj_txt_in) {
static auto mng = InlineMarkup();
@@ -2569,13 +2571,13 @@ static struct ObjInlineMarkupMunge {
bool flg_notes_reg = false;
bool flg_notes_star = false;
bool flg_notes_plus = false;
+ if (!(stage_reset_note_numbers) && reset_note_numbers) {
+ stage_reset_note_numbers = true;
+ }
obj_txt_in = obj_txt_in.replaceAll(
rgx.inline_notes_curly,
(mkup.en_a_o ~ " $1" ~ mkup.en_a_c)
);
- if (!(stage_reset_note_numbers) && reset_note_numbers) {
- stage_reset_note_numbers = true;
- }
obj_txt_out = "";
if (obj_txt_in.match(rgx.inline_notes_al_gen)) {
string[] _tmp_txt;
@@ -2586,6 +2588,8 @@ static struct ObjInlineMarkupMunge {
n_foot_reg = 0;
n_foot_sp_asterisk = 0;
n_foot_sp_plus = 0;
+ n_foot_ed_asterisk = 0;
+ n_foot_ed_plus = 0;
}
stage_reset_note_numbers = false;
foreach(n; m) {
@@ -2627,6 +2631,33 @@ static struct ObjInlineMarkupMunge {
} else {
obj_txt_out = obj_txt_in;
}
+ /+ ↓ editor's notes: ~[* note ]~ and ~[+ note ]~, and a bare ~[ note ]~,
+ which joins the asterisk series as it did in sisu. Each series is
+ numbered through the document, apart from the author's notes:
+ ,*1, *2 ... and +1, +2 ...
+ .
+ Placed after the author's notes rather than before, so that the reset
+ above, made once per document at its first note, has happened by the
+ time these are counted.
+ +/
+ if (obj_txt_out.match(rgx.inline_notes_square)) {
+ if (stage_reset_note_numbers) {
+ n_foot = 0;
+ n_foot_reg = 0;
+ n_foot_sp_asterisk = 0;
+ n_foot_sp_plus = 0;
+ n_foot_ed_asterisk = 0;
+ n_foot_ed_plus = 0;
+ stage_reset_note_numbers = false;
+ }
+ obj_txt_out = replaceAll!((m) {
+ string _series = (m["series"] == "+") ? "+" : "*";
+ int _n = (_series == "+") ? ++n_foot_ed_plus : ++n_foot_ed_asterisk;
+ if (_series == "+") { flg_notes_plus = true; }
+ return mkup.en_a_o ~ _series ~ _n.to!string ~ " " ~ m["note"] ~ mkup.en_a_c;
+ })(obj_txt_out, rgx.inline_notes_square);
+ flg_notes_star = true;
+ }
ST_txtPlusHasFootnotes ret;
{
ret.obj_txt = obj_txt_out;