diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-01-31 21:41:55 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-01-31 21:41:55 -0500 |
commit | ee132f1146cbed3266b448e1cea312375c201cf1 (patch) | |
tree | 37498d07d78fa16e21361ccbefeb2adc0d9e6039 /lib/sisu/v4/epub_tune.rb | |
parent | debian/changelog (4.0.3-1) (diff) | |
parent | v4 (v3): version & changelog, dates touched (diff) |
Merge tag 'sisu_4.0.4' into debian/sid
Diffstat (limited to 'lib/sisu/v4/epub_tune.rb')
-rw-r--r-- | lib/sisu/v4/epub_tune.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sisu/v4/epub_tune.rb b/lib/sisu/v4/epub_tune.rb index b64fd675..f34db8ff 100644 --- a/lib/sisu/v4/epub_tune.rb +++ b/lib/sisu/v4/epub_tune.rb @@ -103,7 +103,7 @@ module SiSU_EPUB_Tune str=str.gsub(/#{Mx[:gl_o]}(#[0-9]{3})#{Mx[:gl_c]}/u,'&\1;'). gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;'). gsub(/<br>/u,'<br />'). - gsub(/#{Mx[:nbsp]}/u,' ') + gsub(/#{Mx[:nbsp]}/u,$ep[:hsp]) end end class Tune @@ -151,8 +151,8 @@ module SiSU_EPUB_Tune gsub(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'<del>\1</del>'). gsub(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'<tt>\1</tt>'). # tt, kbd gsub(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,''). - gsub(/#{Mx[:gl_bullet]}/m,'● '). - gsub(/#{Mx[:nbsp]}/,' '). + gsub(/#{Mx[:gl_bullet]}/m,"●#{$ep[:hsp]*2}"). + gsub(/#{Mx[:nbsp]}/,$ep[:hsp]). gsub(/<(p|br)>/,'<\1 />') dob.obj=SiSU_EPUB_Tune::CleanXHTML.new(dob.obj).clean @tuned_file << dob @@ -253,9 +253,9 @@ module SiSU_EPUB_Tune %{\n<center><a href="\\1" target="_top"><img src="#{@env.url.images_epub}/\\2" alt="\\3" /></a></center>\n}) end dob.obj=dob.obj.gsub(/!pick/,%{<img border="0" height="15" width="15" src="#{@env.url.images_epub}/#{@vz.icon_choice}" alt="stellar" />}). - gsub(/!new/,%{ <img border="0" height="15" width="15" src="#{@env.url.images_epub}/#{@vz.icon_new}" alt="new" />}). + gsub(/!new/,%{#{$ep[:hsp]}<img border="0" height="15" width="15" src="#{@env.url.images_epub}/#{@vz.icon_new}" alt="new" />}). gsub(/<:h(.{1,7}?)>/,'<a href="#h\1">\1</a>'). - gsub(/<:to(\d{1,7}?)>/,'<a href="#to\1">to { \1 }</a> '). + gsub(/<:to(\d{1,7}?)>/,%{<a href="#to\\1">to#{$ep[:hsp]}\{#{$ep[:hsp]}\\1#{$ep[:hsp]}\}</a> }). gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>'). #http ftp matches escaped, no decoration gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="mailto:\\1">\\1</a>#{@brace_url.xml_close}}). gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@brace_url.xml_close}}) #http ftp matches with decoration |