diff options
Diffstat (limited to 'src/sdp/ao_abstract_doc_source.d')
-rw-r--r-- | src/sdp/ao_abstract_doc_source.d | 72 |
1 files changed, 52 insertions, 20 deletions
diff --git a/src/sdp/ao_abstract_doc_source.d b/src/sdp/ao_abstract_doc_source.d index cd1c266..12bbd71 100644 --- a/src/sdp/ao_abstract_doc_source.d +++ b/src/sdp/ao_abstract_doc_source.d @@ -1211,6 +1211,14 @@ template SiSUdocAbstraction() { } html_segnames_ptr_cntr++; } + string[] _images; + auto extract_images(S)(S content_block) { + string[] images_; + if (auto m = matchAll(content_block, rgx.image)) { + images_ ~= m.captures[1]; + } + return images_; + } foreach (ref obj; the_document_head_section) { if (obj.is_a == "heading") { debug(dom) { @@ -1220,8 +1228,10 @@ template SiSUdocAbstraction() { || (opt_action_bool["html_scroll"]) || (opt_action_bool["html_seg"]) || (opt_action_bool["epub"])) { - obj.dom_markedup = dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj.dom_markedup = + dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; + obj.dom_collapsed = + dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; } heading_ancestors(obj, lv_ancestors); } @@ -1239,8 +1249,10 @@ template SiSUdocAbstraction() { || (opt_action_bool["html_scroll"]) || (opt_action_bool["html_seg"]) || (opt_action_bool["epub"])) { - obj.dom_markedup = dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj.dom_markedup = + dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; + obj.dom_collapsed = + dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; } heading_ancestors(obj, lv_ancestors); } @@ -1260,8 +1272,10 @@ template SiSUdocAbstraction() { || (opt_action_bool["html_scroll"]) || (opt_action_bool["html_seg"]) || (opt_action_bool["epub"])) { - obj.dom_markedup = dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj.dom_markedup = + dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; + obj.dom_collapsed = + dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; } heading_ancestors(obj, lv_ancestors); } @@ -1286,13 +1300,18 @@ template SiSUdocAbstraction() { || (opt_action_bool["html_scroll"]) || (opt_action_bool["html_seg"]) || (opt_action_bool["epub"])) { - obj.dom_markedup = dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj.dom_markedup = + dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; + obj.dom_collapsed = + dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; } heading_ancestors(obj, lv_ancestors); + } else if (obj.is_a == "para") { + _images ~= extract_images(obj.text); } } } + auto images=uniq(_images.sort()); /+ optional only one 1~ level +/ if (the_endnotes_section.length > 1) { dom_markedup_buffer = dom_markedup.dup; @@ -1315,8 +1334,10 @@ template SiSUdocAbstraction() { || (opt_action_bool["html_scroll"]) || (opt_action_bool["html_seg"]) || (opt_action_bool["epub"])) { - obj.dom_markedup = dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj.dom_markedup = + dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; + obj.dom_collapsed = + dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; } heading_ancestors(obj, lv_ancestors); } @@ -1340,8 +1361,10 @@ template SiSUdocAbstraction() { || (opt_action_bool["html_scroll"]) || (opt_action_bool["html_seg"]) || (opt_action_bool["epub"])) { - obj.dom_markedup = dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj.dom_markedup = + dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; + obj.dom_collapsed = + dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; } heading_ancestors(obj, lv_ancestors); } @@ -1365,8 +1388,10 @@ template SiSUdocAbstraction() { || (opt_action_bool["html_scroll"]) || (opt_action_bool["html_seg"]) || (opt_action_bool["epub"])) { - obj.dom_markedup = dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj.dom_markedup = + dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; + obj.dom_collapsed = + dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; } heading_ancestors(obj, lv_ancestors); } @@ -1392,8 +1417,10 @@ template SiSUdocAbstraction() { || (opt_action_bool["html_scroll"]) || (opt_action_bool["html_seg"]) || (opt_action_bool["epub"])) { - obj.dom_markedup = dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj.dom_markedup = + dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; + obj.dom_collapsed = + dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; } heading_ancestors(obj, lv_ancestors); } @@ -1416,8 +1443,10 @@ template SiSUdocAbstraction() { || (opt_action_bool["html_scroll"]) || (opt_action_bool["html_seg"]) || (opt_action_bool["epub"])) { - obj.dom_markedup = dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj.dom_markedup = + dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; + obj.dom_collapsed = + dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; } heading_ancestors(obj, lv_ancestors); } @@ -1441,8 +1470,10 @@ template SiSUdocAbstraction() { || (opt_action_bool["html_scroll"]) || (opt_action_bool["html_seg"]) || (opt_action_bool["epub"])) { - obj.dom_markedup = dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; - obj.dom_collapsed = dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; + obj.dom_markedup = + dom_set_markup_tags(dom_markedup, obj.heading_lev_markup).dup; + obj.dom_collapsed = + dom_set_collapsed_tags(dom_collapsed, obj.heading_lev_collapsed).dup; } heading_ancestors(obj, lv_ancestors); } @@ -1525,6 +1556,7 @@ template SiSUdocAbstraction() { document_the, document_section_keys_sequenced, html_segnames, + images, ); return t; /+ post loop markup document/text ↑ +/ |