From 69c9a85008a58e74846e6e22420f3ecb2e840d32 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 28 Sep 2018 21:07:50 -0400 Subject: output xmls, work on internal links --- src/doc_reform/output/xmls.d | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/doc_reform/output/xmls.d') diff --git a/src/doc_reform/output/xmls.d b/src/doc_reform/output/xmls.d index e68a22d..7a1a812 100644 --- a/src/doc_reform/output/xmls.d +++ b/src/doc_reform/output/xmls.d @@ -349,6 +349,18 @@ template outputXHTMLs() { rgx.inline_seg_link, "$1"); } + if (_xml_type == "seg" || _xml_type == "epub") { + if (auto m = _txt.match(rgx.inline_link_hash)) { + foreach (segname; doc_matters.xml.segnames) { + if (auto n = segname.match(m.captures[3])) { + _txt = _txt.replaceFirst( + rgx.inline_link_hash, + "┥$1┝┤$3" ~ _suffix ~ "├"); + break; + } + } + } + } _txt = (_txt) .replaceAll( rgx.inline_link_fn_suffix, @@ -591,7 +603,7 @@ template outputXHTMLs() { if (obj.metainfo.object_number.empty) { o = format(q"¶%s
- %s + %s %s
¶", @@ -599,6 +611,7 @@ template outputXHTMLs() { obj.metainfo.heading_lev_markup, obj.metainfo.is_a, tags, + obj.tags.segment_anchor_tag, _txt, obj.metainfo.heading_lev_markup, ); @@ -606,7 +619,7 @@ template outputXHTMLs() { o = format(q"¶%s
- %s + %s %s
¶", @@ -618,6 +631,7 @@ template outputXHTMLs() { obj.metainfo.object_number, obj.metainfo.object_number, tags, + obj.tags.segment_anchor_tag, _txt, obj.metainfo.heading_lev_markup, ); -- cgit v1.2.3