From d28ce48b155a11bf4f313982139f4697120e2df1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 28 Feb 2017 15:26:52 -0500 Subject: work on outputs --- src/sdp/output_xhtmls.d | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'src/sdp/output_xhtmls.d') 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, "
"); + return _txt; + } + string font_face(string _txt){ + _txt = (_txt) + .replaceAll(rgx.inline_emphasis, ("$1")) + .replaceAll(rgx.inline_bold, ("$1")) + .replaceAll(rgx.inline_underscore, ("$1")) + .replaceAll(rgx.inline_italics, ("$1")) + .replaceAll(rgx.inline_superscript, ("$1")) + .replaceAll(rgx.inline_subscript, ("$1")) + .replaceAll(rgx.inline_strike, ("$1")) + .replaceAll(rgx.inline_insert, ("$1")) + .replaceAll(rgx.inline_mono, ("$1")) + .replaceAll(rgx.inline_cite, ("$1")); + 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) ? ("●  " ~ _txt) : _txt; if (obj.obj_cite_number.empty) { o = format(q"¶

%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, "
\n") + .replaceAll(rgx.nbsp_char, " "); string o; if (obj.obj_cite_number.empty) { o = format(q"¶

@@ -447,7 +477,7 @@ template outputXHTMLs() {

¶", obj.is_a, - obj.text + _txt ); } else { o = format(q"¶
@@ -460,7 +490,7 @@ template outputXHTMLs() { obj.obj_cite_number, obj.is_a, obj.obj_cite_number, - obj.text + _txt ); } return o; -- cgit v1.2.3