diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-02-20 22:30:24 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-02-20 22:30:24 -0500 |
commit | 1c33d8106063e96da4750098efce9b8d9f87cc02 (patch) | |
tree | 76f2006cb0385bef8a796e64b25cfaac3e2d6425 /lib/sisu/v3 | |
parent | debian/changelog (4.0.7-1) (diff) | |
parent | v4 (v3): version & changelog, dates touched (diff) |
Merge tag 'sisu_4.0.8' into debian/sid
SiSU 4.0.8
Diffstat (limited to 'lib/sisu/v3')
-rw-r--r-- | lib/sisu/v3/epub_format.rb | 6 | ||||
-rw-r--r-- | lib/sisu/v3/epub_tune.rb | 8 | ||||
-rw-r--r-- | lib/sisu/v3/html_tune.rb | 9 |
3 files changed, 14 insertions, 9 deletions
diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb index 61accf22..228c2df4 100644 --- a/lib/sisu/v3/epub_format.rb +++ b/lib/sisu/v3/epub_format.rb @@ -1402,7 +1402,7 @@ output_epub_cont_seg.close end def navpoint(dob,no,name=nil) name=name ? name : dob.name - cont_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) + cont_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \ ? '' : "-#{no}" @@ -1597,7 +1597,7 @@ output_epub_cont_seg.close end def manifest_content(dob,name=nil) name=name ? name : dob.name - href_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) + href_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) <<-WOK <item id="#{name}" href="#{href_name}" media-type="application/xhtml+xml" /> WOK @@ -1654,7 +1654,7 @@ output_epub_cont_seg.close end def guide(dob,name=nil) name=name ? name : dob.name - guide_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) + guide_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) <<-WOK <reference type="text" href="#{guide_name}" /> WOK diff --git a/lib/sisu/v3/epub_tune.rb b/lib/sisu/v3/epub_tune.rb index a6b23a0d..664f143e 100644 --- a/lib/sisu/v3/epub_tune.rb +++ b/lib/sisu/v3/epub_tune.rb @@ -123,7 +123,7 @@ module SiSU_EPUB_Tune begin @cX=SiSU_Screen::Ansi.new(@md.opt.cmd).cX SiSU_Screen::Ansi.new(@md.opt.cmd,'Tune').txt_grey if @md.opt.cmd =~/[MVv]/ - data=SiSU_EPUB_Tune::Tune.new(@data,@md).amp_html + data=SiSU_EPUB_Tune::Tune.new(@data,@md).amp_angle_brackets data=SiSU_EPUB_Tune::Tune.new(data,@md).endnotes_html data=SiSU_EPUB_Tune::Tune.new(data,@md).url_markup data=SiSU_EPUB_Tune::Tune.new(data,@md).markup @@ -274,10 +274,12 @@ module SiSU_EPUB_Tune @tuned_file << dob end end - def amp_html + def amp_angle_brackets data,data_new=@data,[] data.each do |dob| - dob.obj=dob.obj.gsub(/&/u,'&') + dob.obj=dob.obj. + gsub(/&/u,'&'). + gsub(/</u,'<').gsub(/>/u,'>') data_new << dob end data_new 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,'&'). + gsub(/<([a-z:\/]+)>/,"#{Dx[:lt_xml]}\\1#{Dx[:gt_xml]}"). + gsub(/</u,'<').gsub(/>/u,'>') dob end def endnotes_html(dob) |