diff options
author | Ralph Amissah <ralph@amissah.com> | 2017-03-28 20:39:35 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:14 -0400 |
commit | 04c7fafa159760ff5ae999eb97047f271a0a549b (patch) | |
tree | 1a9c1cf34cd032de20a9b0de224c0cbb8c75d37d /src/sdp/ao_abstract_doc_source.d | |
parent | output, move stuff about (diff) |
0.13.8 endnotes for various types of block
Diffstat (limited to 'src/sdp/ao_abstract_doc_source.d')
-rw-r--r-- | src/sdp/ao_abstract_doc_source.d | 59 |
1 files changed, 47 insertions, 12 deletions
diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d index 4b3ea1f..2a27e64 100644 --- a/src/sdp/ao_abstract_doc_source.d +++ b/src/sdp/ao_abstract_doc_source.d @@ -564,10 +564,20 @@ template SiSUdocAbstraction() { /+ within block object: group +/ } else if (type["group"] == TriState.on) { /+ within block object: group +/ + line = (line) + .replaceAll(rgx.para_delimiter, mkup.br_paragraph ~ "$1"); _group_block_(line, an_object, type); continue; } else if (type["block"] == TriState.on) { /+ within block object: block +/ + if (auto m = line.match(rgx.spaces_line_start)) { + line = (line) + .replaceAll(rgx.spaces_line_start, (m.captures[1]).translate([ ' ' : mkup.nbsp ])); + } + if (auto m = line.match(rgx.spaces_multiple)) { + line = (line) + .replaceAll(rgx.spaces_multiple, (m.captures[1]).translate([ ' ' : mkup.nbsp ])); + } _block_block_(line, an_object, type); continue; } else if (type["poem"] == TriState.on) { @@ -849,7 +859,10 @@ template SiSUdocAbstraction() { if (the_document_body_section.length > 0) { if (((the_document_body_section[$-1].is_a == "para") || (the_document_body_section[$-1].is_a == "heading") - || (the_document_body_section[$-1].is_a == "group")) + || (the_document_body_section[$-1].is_a == "quote") + || (the_document_body_section[$-1].is_a == "group") + || (the_document_body_section[$-1].is_a == "block") + || (the_document_body_section[$-1].is_a == "verse")) && (the_document_body_section.length > previous_length)) { if ((the_document_body_section[$-1].is_a == "heading") && (the_document_body_section[$-1].heading_lev_markup < 5)) { @@ -857,17 +870,36 @@ template SiSUdocAbstraction() { type["glossary_section"] = State.off; type["blurb_section"] = State.off; } - previous_length = the_document_body_section.length.to!int; - if ((the_document_body_section[$-1].text).match( - rgx.inline_notes_delimiter_al_regular_number_note - )) { - previous_count=(the_document_body_section.length -1).to!int; - note_section.gather_notes_for_endnote_section( - the_document_body_section, - segment_anchor_tag_that_object_belongs_to, - to!int(the_document_body_section.length-1), - ); + if (the_document_body_section[$-1].is_a == "verse") { + /+ scan for endnotes for whole poem (each verse in poem) +/ + foreach (i; previous_length .. the_document_body_section.length) { + if (the_document_body_section[i].is_a == "verse") { + if ((the_document_body_section[i].text).match( + rgx.inline_notes_delimiter_al_regular_number_note + )) { + note_section.gather_notes_for_endnote_section( + the_document_body_section, + segment_anchor_tag_that_object_belongs_to, + to!int(i), + ); + } + } + } + } else { + /+ scan object for endnotes +/ + previous_length = the_document_body_section.length.to!int; + if ((the_document_body_section[$-1].text).match( + rgx.inline_notes_delimiter_al_regular_number_note + )) { + previous_count=(the_document_body_section.length -1).to!int; + note_section.gather_notes_for_endnote_section( + the_document_body_section, + segment_anchor_tag_that_object_belongs_to, + to!int(the_document_body_section.length-1), + ); + } } + previous_length = the_document_body_section.length.to!int; } } } /+ ← closed: loop markup document/text line by line +/ @@ -4729,7 +4761,10 @@ template SiSUdocAbstraction() { in { assert((contents_am[cntr].is_a == "para") || (contents_am[cntr].is_a == "heading") - || (contents_am[cntr].is_a == "group")); + || (contents_am[cntr].is_a == "quote") + || (contents_am[cntr].is_a == "group") + || (contents_am[cntr].is_a == "block") + || (contents_am[cntr].is_a == "verse")); assert(cntr >= previous_count); previous_count=cntr; assert( |