diff options
| -rw-r--r-- | org/output_xmls.org | 30 | ||||
| -rw-r--r-- | src/sdp/output/epub3.d | 15 | ||||
| -rw-r--r-- | src/sdp/output/xmls.d | 9 | 
3 files changed, 40 insertions, 14 deletions
| diff --git a/org/output_xmls.org b/org/output_xmls.org index c402a43..18a0315 100644 --- a/org/output_xmls.org +++ b/org/output_xmls.org @@ -73,6 +73,21 @@ string special_characters(O)(  }  #+END_SRC +**** special characters text + +#+name: xhtml_format_objects +#+BEGIN_SRC d +string special_characters_text(string _txt){ +  _txt = (_txt) +    .replaceAll(rgx.xhtml_ampersand,    "&") +    .replaceAll(rgx.xhtml_quotation,    """) +    .replaceAll(rgx.xhtml_less_than,    "<") +    .replaceAll(rgx.xhtml_greater_than, ">") +    .replaceAll(rgx.nbsp_char,          " "); +  return _txt; +} +#+END_SRC +  **** font_face  #+name: xhtml_format_objects @@ -1617,6 +1632,7 @@ xmlns="urn:oasis:names:tc:opendocument:xmlns:container">  #+name: output_epub3_constructs  #+BEGIN_SRC d  string epub3_oebps_content(D,I,P)(D doc_abstraction, I doc_matters, P parts) { +  auto xhtml_format = outputXHTMLs();    auto pth_epub3 = SiSUpathsEPUB!()(doc_matters.src_path_info, doc_matters.language);    string uuid = "18275d951861c77f78acd05672c9906924c59f18a2e0ba06dad95959693e9bd8"; // TODO sort uuid in doc_matters!    string content = format(q"¶  <?xml version='1.0' encoding='utf-8'?> @@ -1648,19 +1664,19 @@ string epub3_oebps_content(D,I,P)(D doc_abstraction, I doc_matters, P parts) {        <item id="nav" href="toc_nav.xhtml" media-type="application/xhtml+xml" properties="nav" />  ¶",      uuid, -    doc_matters.dochead_meta["title"]["full"], -    doc_matters.dochead_meta["title"]["main"], +    xhtml_format.special_characters_text(doc_matters.dochead_meta["title"]["full"]), +    xhtml_format.special_characters_text(doc_matters.dochead_meta["title"]["main"]),      (doc_matters.dochead_meta["title"]["sub"].empty) -      ? "" : doc_matters.dochead_meta["title"]["sub"], +      ? "" : xhtml_format.special_characters_text(doc_matters.dochead_meta["title"]["sub"]),      (doc_matters.dochead_meta["creator"]["author"].empty) -      ? "" : doc_matters.dochead_meta["creator"]["author"], +      ? "" : xhtml_format.special_characters_text(doc_matters.dochead_meta["creator"]["author"]),      (doc_matters.dochead_meta["creator"]["author"].empty) -      ? "" : doc_matters.dochead_meta["creator"]["author"], +      ? "" : xhtml_format.special_characters_text(doc_matters.dochead_meta["creator"]["author"]),      doc_matters.language,      (doc_matters.dochead_meta["date"]["published"].empty) -      ? "" : doc_matters.dochead_meta["date"]["published"], +      ? "" : xhtml_format.special_characters_text(doc_matters.dochead_meta["date"]["published"]),      (doc_matters.dochead_meta["rights"]["copyright"].empty) -      ? "" : doc_matters.dochead_meta["rights"]["copyright"], +      ? "" : xhtml_format.special_characters_text(doc_matters.dochead_meta["rights"]["copyright"]),      uuid,      uuid,      uuid, diff --git a/src/sdp/output/epub3.d b/src/sdp/output/epub3.d index 0f91c86..b05cf20 100644 --- a/src/sdp/output/epub3.d +++ b/src/sdp/output/epub3.d @@ -30,6 +30,7 @@ template outputEPub3() {      return o;    }    string epub3_oebps_content(D,I,P)(D doc_abstraction, I doc_matters, P parts) { +    auto xhtml_format = outputXHTMLs();      auto pth_epub3 = SiSUpathsEPUB!()(doc_matters.src_path_info, doc_matters.language);      string uuid = "18275d951861c77f78acd05672c9906924c59f18a2e0ba06dad95959693e9bd8"; // TODO sort uuid in doc_matters!      string content = format(q"¶  <?xml version='1.0' encoding='utf-8'?> @@ -61,19 +62,19 @@ template outputEPub3() {          <item id="nav" href="toc_nav.xhtml" media-type="application/xhtml+xml" properties="nav" />    ¶",        uuid, -      doc_matters.dochead_meta["title"]["full"], -      doc_matters.dochead_meta["title"]["main"], +      xhtml_format.special_characters_text(doc_matters.dochead_meta["title"]["full"]), +      xhtml_format.special_characters_text(doc_matters.dochead_meta["title"]["main"]),        (doc_matters.dochead_meta["title"]["sub"].empty) -        ? "" : doc_matters.dochead_meta["title"]["sub"], +        ? "" : xhtml_format.special_characters_text(doc_matters.dochead_meta["title"]["sub"]),        (doc_matters.dochead_meta["creator"]["author"].empty) -        ? "" : doc_matters.dochead_meta["creator"]["author"], +        ? "" : xhtml_format.special_characters_text(doc_matters.dochead_meta["creator"]["author"]),        (doc_matters.dochead_meta["creator"]["author"].empty) -        ? "" : doc_matters.dochead_meta["creator"]["author"], +        ? "" : xhtml_format.special_characters_text(doc_matters.dochead_meta["creator"]["author"]),        doc_matters.language,        (doc_matters.dochead_meta["date"]["published"].empty) -        ? "" : doc_matters.dochead_meta["date"]["published"], +        ? "" : xhtml_format.special_characters_text(doc_matters.dochead_meta["date"]["published"]),        (doc_matters.dochead_meta["rights"]["copyright"].empty) -        ? "" : doc_matters.dochead_meta["rights"]["copyright"], +        ? "" : xhtml_format.special_characters_text(doc_matters.dochead_meta["rights"]["copyright"]),        uuid,        uuid,        uuid, diff --git a/src/sdp/output/xmls.d b/src/sdp/output/xmls.d index ed9b548..2482f28 100644 --- a/src/sdp/output/xmls.d +++ b/src/sdp/output/xmls.d @@ -30,6 +30,15 @@ template outputXHTMLs() {        }        return _txt;      } +    string special_characters_text(string _txt){ +      _txt = (_txt) +        .replaceAll(rgx.xhtml_ampersand,    "&") +        .replaceAll(rgx.xhtml_quotation,    """) +        .replaceAll(rgx.xhtml_less_than,    "<") +        .replaceAll(rgx.xhtml_greater_than, ">") +        .replaceAll(rgx.nbsp_char,          " "); +      return _txt; +    }      string font_face(string _txt){        _txt = (_txt)          .replaceAll(rgx.inline_emphasis,    ("<em>$1</em>")) | 
