aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-02-20 22:01:42 -0500
committerRalph Amissah <ralph@amissah.com>2013-02-20 22:21:06 -0500
commit32a0e39ad09dab218a5bc225e165ad92611b2c38 (patch)
treea78f4bbfa29c2630403d5cf4a0be1b373d1e98af /lib
parentv4 (v3): epub, tinkering with headers & cleaning of angle brackets '<' & '>' (diff)
v4 (v3): html, modification to markup of angle brackets [<>] & ampersand [&]
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v3/html_tune.rb9
-rw-r--r--lib/sisu/v4/html_tune.rb9
2 files changed, 12 insertions, 6 deletions
diff --git a/lib/sisu/v3/html_tune.rb b/lib/sisu/v3/html_tune.rb
index 32426076..23fa586e 100644
--- a/lib/sisu/v3/html_tune.rb
+++ b/lib/sisu/v3/html_tune.rb
@@ -144,7 +144,7 @@ module SiSU_HTML_Tune
data_tuned=[]
#@tuned_file=[]
data.each do |dob|
- dob=angle_brackets(dob)
+ dob=amp_angle_brackets(dob)
dob=endnotes_html(dob)
dob=url_markup(dob)
dob=markup(dob)
@@ -241,8 +241,11 @@ module SiSU_HTML_Tune
end
dob
end
- def angle_brackets(dob)
- dob.obj=dob.obj.gsub(/<([a-z:\/]+)>/,"#{Dx[:lt_xml]}\\1#{Dx[:gt_xml]}")
+ def amp_angle_brackets(dob)
+ dob.obj=dob.obj.
+ gsub(/&/u,'&amp;').
+ gsub(/<([a-z:\/]+)>/,"#{Dx[:lt_xml]}\\1#{Dx[:gt_xml]}").
+ gsub(/</u,'&lt;').gsub(/>/u,'&gt;')
dob
end
def endnotes_html(dob)
diff --git a/lib/sisu/v4/html_tune.rb b/lib/sisu/v4/html_tune.rb
index 2661ee52..41845007 100644
--- a/lib/sisu/v4/html_tune.rb
+++ b/lib/sisu/v4/html_tune.rb
@@ -144,7 +144,7 @@ module SiSU_HTML_Tune
data_tuned=[]
#@tuned_file=[]
data.each do |dob|
- dob=angle_brackets(dob)
+ dob=amp_angle_brackets(dob)
dob=endnotes_html(dob)
dob=url_markup(dob)
dob=markup(dob)
@@ -241,8 +241,11 @@ module SiSU_HTML_Tune
end
dob
end
- def angle_brackets(dob)
- dob.obj=dob.obj.gsub(/<([a-z:\/]+)>/,"#{Dx[:lt_xml]}\\1#{Dx[:gt_xml]}")
+ def amp_angle_brackets(dob)
+ dob.obj=dob.obj.
+ gsub(/&/u,'&amp;').
+ gsub(/<([a-z:\/]+)>/,"#{Dx[:lt_xml]}\\1#{Dx[:gt_xml]}").
+ gsub(/</u,'&lt;').gsub(/>/u,'&gt;')
dob
end
def endnotes_html(dob)