diff options
Diffstat (limited to 'src/sisudoc/meta/metadoc_from_src_functions.d')
-rw-r--r-- | src/sisudoc/meta/metadoc_from_src_functions.d | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sisudoc/meta/metadoc_from_src_functions.d b/src/sisudoc/meta/metadoc_from_src_functions.d index 6718e82..53e494b 100644 --- a/src/sisudoc/meta/metadoc_from_src_functions.d +++ b/src/sisudoc/meta/metadoc_from_src_functions.d @@ -4233,11 +4233,31 @@ template docAbstractionFunctions() { int html_segnames_ptr_cntr, int html_segnames_ptr, ) { + string[string][string] notes_; + if (the_document_body_section.length > 1) { + string _notes; + foreach (ref obj; the_document_body_section) { + if (obj.has.inline_notes_reg) { + if ((obj.text).matchFirst(rgx.inline_notes_al_gen)) { + foreach (m; (obj.text).matchAll(rgx.inline_notes_al_regular_number_note)) { + _notes ~= "\n\n" ~ m["num"] ~ ". " ~ m["note"] ~ " ≫" ~ obj.metainfo.ocn.to!string; + notes_[(m["num"])]["ocn"] = obj.metainfo.ocn.to!string; + } + } + } + } + } if (the_document_endnotes_section.length > 1) { segnames["html"] ~= "endnotes"; segnames["epub"] ~= "endnotes"; html_segnames_ptr = html_segnames_ptr_cntr; foreach (ref obj; the_document_endnotes_section) { + auto matches = (obj.text).matchAll(rgx.endnote_section_note); + foreach (m; matches) { + obj.text = m.hit ~ " ≫" ~ notes_[(m["notenumber"])]["ocn"]; + } + } + foreach (ref obj; the_document_endnotes_section) { if (obj.metainfo.is_a == "heading") { obj.metainfo.parent_ocn = obj.metainfo.markedup_ancestors[obj.metainfo.parent_lev_markup]; } |