aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-08-27 13:56:18 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-08-28 10:29:40 -0400
commitd89584e65a327d6231f733afe243006c7beb9bb7 (patch)
tree666e92c10c3d180d513c3359feae490ca9619d4c /src/sisudoc
parentdoc_has: count inline links & notes, always 0, fix (diff)
image digest: include headings in image scan
Assumed that headings do not include images, obj_digest() looked for images only in the non-heading branch, however, the markup does not forbid one, and an object type left out of the scan carries neither digest nor .ssp record, silently. Open Issue: image_list, which drives pod bundling and the @doc_has images count, is gathered only from para objects (and only the first image of each), so an image in a heading or in a block body is recorded in the abstraction but not bundled. (assisted by Claude-Code)
Diffstat (limited to 'src/sisudoc')
-rw-r--r--src/sisudoc/ocda/meta/metadoc_from_src_functions.d38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/sisudoc/ocda/meta/metadoc_from_src_functions.d b/src/sisudoc/ocda/meta/metadoc_from_src_functions.d
index 1bc1e81..9824d61 100644
--- a/src/sisudoc/ocda/meta/metadoc_from_src_functions.d
+++ b/src/sisudoc/ocda/meta/metadoc_from_src_functions.d
@@ -3259,30 +3259,34 @@ template docAbstractionFunctions() {
string image_path = manifested.src.image_dir_path ~ "/";
char[64] image_hash;
int n = 0;
+ /+ ↓ images, scanned for in every object type: the markup does not
+ forbid an image in a heading, and an object type excluded from the
+ scan would carry neither digest nor record, silently
+ +/
+ if ((obj.text).match(rgx.inline_image)) {
+ foreach (m; (obj.text).matchAll(rgx.inline_image)) {
+ image_with_path = image_path ~ m["img"];
+ ST_file_name_hash_size_ _file_info = safeComputeHashAndSize(m["img"], image_path);
+ obj.metainfo.sha256.images ~= [_file_info];
+ }
+ }
+ char[] image_summary;
+ if (obj.metainfo.sha256.images.length > 0) {
+ foreach (i; obj.metainfo.sha256.images) {
+ image_summary ~= (i.fileMissing)
+ ? "\n - " ~ "MISSING OR UNREADABLE" ~ " - " ~ i.fileName
+ : "\n - " ~ i.fileHash_sha256.toHexString ~ "::" ~ i.fileSize.to!string ~ " - " ~ i.fileName;
+ }
+ }
if (obj.metainfo.is_a == "heading") {
obj.metainfo.sha256.summary ~=
"• - " ~ obj.metainfo.sha256.text.toHexString ~ " "
~ obj.metainfo.ocn.to!string ~ " "
~ obj.metainfo.is_a ~ " "
~ obj.metainfo.marked_up_level ~ "~ "
- ~ obj.text;
- // ~ image_summary; // heading assumed not to have image CONSIDER
+ ~ obj.text
+ ~ image_summary;
} else {
- if ((obj.text).match(rgx.inline_image)) {
- foreach (m; (obj.text).matchAll(rgx.inline_image)) {
- image_with_path = image_path ~ m["img"];
- ST_file_name_hash_size_ _file_info = safeComputeHashAndSize(m["img"], image_path);
- obj.metainfo.sha256.images ~= [_file_info];
- }
- }
- char[] image_summary;
- if (obj.metainfo.sha256.images.length > 0) {
- foreach (i; obj.metainfo.sha256.images) {
- image_summary ~= (i.fileMissing)
- ? "\n - " ~ "MISSING OR UNREADABLE" ~ " - " ~ i.fileName
- : "\n - " ~ i.fileHash_sha256.toHexString ~ "::" ~ i.fileSize.to!string ~ " - " ~ i.fileName;
- }
- }
obj.metainfo.sha256.summary ~=
" - " ~ obj.metainfo.sha256.text.toHexString
~ " " ~ obj.metainfo.ocn.to!string ~ " "