aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/outputs/io_out/odt.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sisudoc/outputs/io_out/odt.d')
-rw-r--r--src/sisudoc/outputs/io_out/odt.d21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sisudoc/outputs/io_out/odt.d b/src/sisudoc/outputs/io_out/odt.d
index 40d760d..d8f6c2f 100644
--- a/src/sisudoc/outputs/io_out/odt.d
+++ b/src/sisudoc/outputs/io_out/odt.d
@@ -107,6 +107,8 @@ template formatODT() {
return _on;
}
string _footnotes()(string _txt) {
+ import std.array : replace;
+ import std.regex : replaceAll;
static auto rgx = RgxO();
static auto rgx_xhtml = RgxXHTML();
_txt = _txt.replaceAll(
@@ -124,6 +126,25 @@ template formatODT() {
"$1", "$1", "$2",
)
);
+ /+ ↓ a note of a special series (*, *1, +1 ...): the same footnote, carrying
+ its mark as the citation's label, since odf numbers a note itself unless
+ instructed otherwise. The id takes the mark spelled in letters, "*" and
+ "+" having no place in one.
+ +/
+ _txt = replaceAll!((m) {
+ string _mark = m["char"];
+ string _id = _mark.replace("*", "a").replace("+", "p");
+ return format(q"┃<text:note text:id="ftn_%s" text:note-class="footnote">
+ <text:note-citation text:label="%s">%s</text:note-citation>
+ <text:note-body>
+ <text:p text:style-name="Footnote">
+ %s
+ </text:p>
+ </text:note-body>
+ </text:note>┃",
+ _id, _mark, _mark, m["note"].strip,
+ );
+ })(_txt, rgx.inline_notes_al_special_char_note);
return _txt;
}
string _bullet(O)(const O obj) {