From 714b25c433bf41e798f98cc7a41026c405c23115 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 27 Aug 2026 13:32:35 -0400 Subject: has.images: set flag but was not assigned, fix every object with an .image record should now carry the images flag. Previously DocObj_Has_.images was read but never written anywhere in the tree, so no object carried it: .ssp emitted has_images = 0 for every object of every document. (assisted by Claude-Code) --- src/sisudoc/ocda/meta/metadoc_from_src.d | 1 + src/sisudoc/ocda/meta/metadoc_from_src_functions.d | 17 +++++++++++++++++ src/sisudoc/ocda/meta/metadoc_object_setter.d | 2 ++ 3 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/sisudoc/ocda/meta/metadoc_from_src.d b/src/sisudoc/ocda/meta/metadoc_from_src.d index dcdc239..cae6c25 100644 --- a/src/sisudoc/ocda/meta/metadoc_from_src.d +++ b/src/sisudoc/ocda/meta/metadoc_from_src.d @@ -768,6 +768,7 @@ template docAbstraction() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; comp_obj_.has.image_without_dimensions = substantive_obj_misc_struct.has_images_without_dimensions; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); diff --git a/src/sisudoc/ocda/meta/metadoc_from_src_functions.d b/src/sisudoc/ocda/meta/metadoc_from_src_functions.d index cc79a67..1bc1e81 100644 --- a/src/sisudoc/ocda/meta/metadoc_from_src_functions.d +++ b/src/sisudoc/ocda/meta/metadoc_from_src_functions.d @@ -713,6 +713,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); } @@ -769,6 +770,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_reset(an_object); @@ -801,6 +803,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_number_poem["end"] = obj_cite_digits.object_number.to!string; @@ -857,6 +860,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_reset(an_object); @@ -889,6 +893,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_number_poem["end"] = obj_cite_digits.object_number.to!string; @@ -945,6 +950,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); object_reset(an_object); @@ -1992,6 +1998,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); pith["block_is"] = eN.blk_is.quote; @@ -2038,6 +2045,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; tag_assoc = an_object.inline_para_link_anchor(tag_in_seg, tag_assoc); pith["block_is"] = eN.blk_is.poem; @@ -2084,6 +2092,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; pith["block_is"] = eN.blk_is.block; pith["block_state"] = eN.blk_state.off; @@ -2162,6 +2171,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_obj_misc_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_obj_misc_struct.has_notes_star; comp_obj_.has.inline_links = substantive_obj_misc_struct.has_links; + comp_obj_.has.images = substantive_obj_misc_struct.has_images; the_document_body_section ~= comp_obj_; pith["block_is"] = eN.blk_is.code; pith["block_state"] = eN.blk_state.off; @@ -2402,6 +2412,7 @@ template docAbstractionFunctions() { ) { obj_txt_out = ""; bool urls = false; + bool images_present = false; bool images_without_dimensions = false; tail = ""; // special endnotes @@ -2416,6 +2427,7 @@ template docAbstractionFunctions() { ); // image matched if (obj_txt_in.match(rgx.smid_image_generic)) { + images_present = true; obj_txt_in = images(obj_txt_in); if (obj_txt_in.match(rgx.smid_mod_image_without_dimensions)) { images_without_dimensions = true; @@ -2447,6 +2459,7 @@ template docAbstractionFunctions() { ret.has_notes_star = ftn.has_notes_star; ret.has_notes_plus = ftn.has_notes_plus; ret.has_urls = urls; + ret.has_images = images_present; ret.has_images_without_dimensions = images_without_dimensions; } return ret; @@ -2462,6 +2475,7 @@ template docAbstractionFunctions() { ret.has_notes_star = false; ret.has_notes_plus = false; ret.has_urls = false; + ret.has_images = false; ret.has_images_without_dimensions = false; } return ret; @@ -2569,6 +2583,7 @@ template docAbstractionFunctions() { ret.has_notes_star = false; ret.has_notes_plus = false; ret.has_links = false; + ret.has_images = false; ret.has_images_without_dimensions = false; if ((obj_["is"] == "para") || (obj_["is"] == "heading") @@ -2629,6 +2644,7 @@ template docAbstractionFunctions() { ret.has_notes_star = x.has_notes_star; ret.has_notes_plus = x.has_notes_plus; ret.has_links = x.has_urls; + ret.has_images = x.has_images; ret.has_images_without_dimensions = x.has_images_without_dimensions; break; } @@ -4623,6 +4639,7 @@ template docAbstractionFunctions() { comp_obj_.has.inline_notes_reg = substantive_object_and_anchor_tags_struct.has_notes_reg; comp_obj_.has.inline_notes_star = substantive_object_and_anchor_tags_struct.has_notes_star; comp_obj_.has.inline_links = substantive_object_and_anchor_tags_struct.has_links; + comp_obj_.has.images = substantive_object_and_anchor_tags_struct.has_images; tag_assoc[comp_obj_.tags.anchor_tag_html]["seg_lv4"] = comp_obj_.tags.in_segment_html; tag_assoc[comp_obj_.tags.segment_anchor_tag_epub]["seg_lv1to4"] = comp_obj_.tags.segment_anchor_tag_epub; debug(_node) { diff --git a/src/sisudoc/ocda/meta/metadoc_object_setter.d b/src/sisudoc/ocda/meta/metadoc_object_setter.d index a88f491..9fcc2b9 100644 --- a/src/sisudoc/ocda/meta/metadoc_object_setter.d +++ b/src/sisudoc/ocda/meta/metadoc_object_setter.d @@ -260,6 +260,7 @@ template ObjectSetter() { bool has_notes_star; bool has_notes_plus; bool has_urls; + bool has_images; bool has_images_without_dimensions; } struct ST_txtAndAnchorTagPlusHasFootnotesUrlsImages { @@ -269,6 +270,7 @@ template ObjectSetter() { bool has_notes_star; bool has_notes_plus; bool has_links; // use same name + bool has_images; bool has_images_without_dimensions; } struct ST_the_section { -- cgit v1.2.3