aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/ocda_functions.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-11 08:07:47 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-09-12 12:14:37 -0400
commit6a241cdc7368bf4cc23ffbc9e83f0adeadc35a9b (patch)
treea59a8bc2e29e7ba4063a1af402fdf51785f6def1 /org/ocda_functions.org
parent0.23.0 (diff)
ocda: get image from is internal image markup
correct circumstance where regex was incorrectly able to match image shaped words as well as identified and marked up image (internal markup). take all matches. (assisted by Claude-Code)
Diffstat (limited to 'org/ocda_functions.org')
-rw-r--r--org/ocda_functions.org11
1 files changed, 8 insertions, 3 deletions
diff --git a/org/ocda_functions.org b/org/ocda_functions.org
index 6ab4bbf..ca8a7be 100644
--- a/org/ocda_functions.org
+++ b/org/ocda_functions.org
@@ -1441,12 +1441,17 @@ ST_flow_table_array_munge flow_table_array_munge()(
#+NAME: ocdaFunc_images
#+HEADER: :noweb yes
#+BEGIN_SRC d
-// ↓ - images
+/+ ↓ - images, the images an object shows.
+ matched on the internal markup an image has become by this stage
+ (┥☼name.png,w640h447 ┝┤├), so a filename-shaped word in prose is not
+ taken for one, and over every match rather than the first, so a
+ paragraph showing two images reports two.
++/
string[] extract_images()(string content_block) {
static auto rgx = RgxI();
string[] images_;
- if (auto m = content_block.matchAll(rgx.image)) {
- images_ ~= m.captures[1];
+ foreach (m; content_block.matchAll(rgx.image_in_object_text)) {
+ images_ ~= m["image"].to!string;
}
return images_;
}