aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/output/xmls.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2018-10-09 13:10:49 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2019-04-10 15:14:15 -0400
commit49f6c45c3d60fe0251843cc23ce289ec23b3501b (patch)
tree70604d0b0a09ca0ec96949bada9f8ec6f0082baa /src/doc_reform/output/xmls.d
parentxmls segmented heading inline links (diff)
internal links
Diffstat (limited to 'src/doc_reform/output/xmls.d')
-rw-r--r--src/doc_reform/output/xmls.d8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/doc_reform/output/xmls.d b/src/doc_reform/output/xmls.d
index 47053f3..571c1af 100644
--- a/src/doc_reform/output/xmls.d
+++ b/src/doc_reform/output/xmls.d
@@ -351,7 +351,7 @@ template outputXHTMLs() {
"$1");
}
if (_xml_type == "seg" || _xml_type == "epub") {
- if (auto m = _txt.match(rgx.inline_link_hash)) {
+ foreach (m; _txt.match(rgx.inline_link_hash)) {
if (m.captures[3] in doc_matters.xml.tag_associations) {
if (m.captures[3] == doc_matters.xml.tag_associations[(m.captures[3])][0]) {
_txt = _txt.replaceFirst(
@@ -609,7 +609,6 @@ template outputXHTMLs() {
string _xml_type = "html",
) {
auto tags = _xhtml_anchor_tags(obj);
- string seg_anchor_tag;
string heading_lev_anchor_tag;
string _horizontal_rule = "<hr />";
if ((_xml_type != "html")
@@ -618,9 +617,6 @@ template outputXHTMLs() {
}
_txt = font_face(_txt);
string o;
- seg_anchor_tag = (obj.tags.segment_anchor_tag.empty)
- ? ""
- : "<a name=\"" ~ obj.tags.segment_anchor_tag ~ "\"></a>";
heading_lev_anchor_tag = (obj.tags.heading_lev_anchor_tag.empty)
? ""
: "<a name=\"" ~ obj.tags.heading_lev_anchor_tag ~ "\"></a>";
@@ -699,6 +695,8 @@ template outputXHTMLs() {
_txt = font_face(_txt);
string o;
_txt = (obj.attrib.bullet) ? ("●&#160;&#160;" ~ _txt) : _txt;
+ _txt = _txt.replaceFirst(rgx.inline_link_anchor,
+ "<a name=\"$1\"></a>");
if (obj.metainfo.object_number.empty) {
o = format(q"¶ <div class="substance">
<p class="%s" indent="h%si%s">%s