aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdp/output_xhtmls.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdp/output_xhtmls.d')
-rw-r--r--src/sdp/output_xhtmls.d34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/sdp/output_xhtmls.d b/src/sdp/output_xhtmls.d
index de5236d..d39298c 100644
--- a/src/sdp/output_xhtmls.d
+++ b/src/sdp/output_xhtmls.d
@@ -25,6 +25,28 @@ template outputXHTMLs() {
mixin SiSUoutputRgxInit;
struct outputXHTMLs {
auto rgx = Rgx();
+ string special_characters(string _txt){
+ _txt = (_txt)
+ .replaceAll(rgx.xhtml_ampersand, "&")
+ .replaceAll(rgx.xhtml_less_than, "<")
+ .replaceAll(rgx.xhtml_greater_than, ">")
+ .replaceAll(rgx.xhtml_line_break, "<br />");
+ return _txt;
+ }
+ string font_face(string _txt){
+ _txt = (_txt)
+ .replaceAll(rgx.inline_emphasis, ("<emph>$1</emph>"))
+ .replaceAll(rgx.inline_bold, ("<b>$1</b>"))
+ .replaceAll(rgx.inline_underscore, ("<u>$1</u>"))
+ .replaceAll(rgx.inline_italics, ("<i>$1</i>"))
+ .replaceAll(rgx.inline_superscript, ("<sup>$1</sup>"))
+ .replaceAll(rgx.inline_subscript, ("<sub>$1</sub>"))
+ .replaceAll(rgx.inline_strike, ("<del>$1</del>"))
+ .replaceAll(rgx.inline_insert, ("<ins>$1</ins>"))
+ .replaceAll(rgx.inline_mono, ("<tt>$1</tt>"))
+ .replaceAll(rgx.inline_cite, ("<cite>$1</cite>"));
+ return _txt;
+ }
string _xhtml_anchor_tags(const(string[]) anchor_tags) {
string tags="";
if (anchor_tags.length > 0) {
@@ -241,6 +263,7 @@ template outputXHTMLs() {
string _suffix = ".html",
) {
string _txt = obj.text;
+ _txt = special_characters(_txt);
_txt = inline_links(obj, _txt, _suffix, "scroll");
_txt = inline_notes_scroll(obj, _txt);
return _txt;
@@ -250,6 +273,7 @@ template outputXHTMLs() {
string _suffix = ".html",
) {
string _txt = obj.text;
+ _txt = special_characters(_txt);
_txt = inline_links(obj, _txt, _suffix, "seg");
auto t = inline_notes_seg(obj, _txt);
return t;
@@ -338,7 +362,9 @@ template outputXHTMLs() {
string _txt,
) {
auto tags = _xhtml_anchor_tags(obj.anchor_tags);
+ _txt = font_face(_txt);
string o;
+ _txt = (obj.bullet) ? ("●&nbsp;&nbsp" ~ _txt) : _txt;
if (obj.obj_cite_number.empty) {
o = format(q"¶ <div class="substance">
<p class="%s" indent="h%si%s">%s
@@ -439,6 +465,10 @@ template outputXHTMLs() {
auto code(O)(
auto return ref const O obj,
) {
+ string _txt = obj.text;
+ _txt = (_txt)
+ .replaceAll(rgx.newline, "<br>\n")
+ .replaceAll(rgx.nbsp_char, "&nbsp;");
string o;
if (obj.obj_cite_number.empty) {
o = format(q"¶ <div class="substance">
@@ -447,7 +477,7 @@ template outputXHTMLs() {
</p>
</div>¶",
obj.is_a,
- obj.text
+ _txt
);
} else {
o = format(q"¶ <div class="substance">
@@ -460,7 +490,7 @@ template outputXHTMLs() {
obj.obj_cite_number,
obj.is_a,
obj.obj_cite_number,
- obj.text
+ _txt
);
}
return o;