From f1d8aac5386f98c912ede3db57999eeeed841f3c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 18 Jan 2017 18:21:18 -0500 Subject: reset ocn on new document (much more re-initializing necessary) --- org/ao_abstract_doc_source.org | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'org') diff --git a/org/ao_abstract_doc_source.org b/org/ao_abstract_doc_source.org index dbc44a0..f77a5ad 100644 --- a/org/ao_abstract_doc_source.org +++ b/org/ao_abstract_doc_source.org @@ -997,7 +997,9 @@ assert( if ((type["heading"] == State.on) && (line_occur["heading"] > State.off)) { /+ heading object (current line empty) +/ - obj_cite_number = ocn_emit(type["ocn_status"]); + obj_cite_number = (to!int(an_object["lev_markup_number"]) == 0) + ? (ocn_emit(3)) + : (obj_cite_number = ocn_emit(type["ocn_status"])); an_object["bookindex_nugget"] = ("bookindex_nugget" in an_object) ? an_object["bookindex_nugget"] : ""; bookindex_unordered_hashes = @@ -3517,11 +3519,15 @@ auto _para_match_( struct OCNemitter { int obj_cite_number, obj_cite_number_; int ocn_emitter(int ocn_status_flag) - in { assert(ocn_status_flag <= 2); } + in { assert(ocn_status_flag <= 3); } body { - obj_cite_number=(ocn_status_flag == 0) - ? ++obj_cite_number_ - : 0; + if (ocn_status_flag == 3) { + obj_cite_number = obj_cite_number_ = 1; + } else { + obj_cite_number=(ocn_status_flag == 0) + ? ++obj_cite_number_ + : 0; + } assert(obj_cite_number >= 0); return obj_cite_number; } -- cgit v1.2.3