aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/epub_tune.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-01-31 18:36:08 -0500
committerRalph Amissah <ralph@amissah.com>2013-01-31 18:36:08 -0500
commit8fe365726f3bb7866a7a9285cb5045c50c39fd67 (patch)
tree29ed9813072aeb435d8b548fe3d24c810689bc93 /lib/sisu/v4/epub_tune.rb
parentv4 v3: dal, on ocn excluded paragraphs (~# -#), hang/indent bullet, fix (diff)
v4: epub, constants, debug alternative for various readers ... work on
Diffstat (limited to 'lib/sisu/v4/epub_tune.rb')
-rw-r--r--lib/sisu/v4/epub_tune.rb10
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,'&nbsp;')
+ 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,'●&nbsp;&nbsp;').
- gsub(/#{Mx[:nbsp]}/,'&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/,%{&nbsp;<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&nbsp;{&nbsp;\1&nbsp;}</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