diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-06-19 22:36:38 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-06-19 22:36:38 -0400 |
commit | ea5affb331624b72a7a5a7ac5614e2d19f347c4d (patch) | |
tree | 2db6a88dc15f0019741254a2a3ea5f78236ef2ff /lib/sisu/v6/xml_fictionbook2.rb | |
parent | debian/changelog (5.4.0-1) (diff) | |
parent | vim syntax, code block, language syntax; box group; quote (diff) |
Merge tag 'sisu_5.4.1' into debian/sid
SiSU 5.4.1
Diffstat (limited to 'lib/sisu/v6/xml_fictionbook2.rb')
-rw-r--r-- | lib/sisu/v6/xml_fictionbook2.rb | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/lib/sisu/v6/xml_fictionbook2.rb b/lib/sisu/v6/xml_fictionbook2.rb index d0ad4a7f..4e580b84 100644 --- a/lib/sisu/v6/xml_fictionbook2.rb +++ b/lib/sisu/v6/xml_fictionbook2.rb @@ -126,8 +126,8 @@ module SiSU_XML_Fictionbook data=markup_text(data) structure_build_collapsed(data,endnotes,images_base64) end - def space - ' ' + def spaces + Ax[:spaces] end def tags # collapsed --> @@ -278,7 +278,7 @@ module SiSU_XML_Fictionbook end def output(o,comment='') puts o.lc == (0..6) \ - ? "#{space*o.lc}<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}</#{o.lc}>#{comment}" + ? "#{spaces*o.lc}<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}</#{o.lc}>#{comment}" : "<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}</#{o.lc}>#{comment}" end def structure_collapsed(data) @@ -315,11 +315,11 @@ module SiSU_XML_Fictionbook filename_fictionbook.puts structure_build_tag_close(o.lc,h) end doc_position=:body_and_tail - filename_fictionbook.puts %{#{space*o.lc}<#{tags.fictionbook[o.lc]}> -#{space*o.lc}<title> + filename_fictionbook.puts %{#{spaces*o.lc}<#{tags.fictionbook[o.lc]}> +#{spaces*o.lc}<title> } filename_fictionbook.puts SiSU_TextUtils::Wrap.new("<p>#{o.obj}#{ocn}</p>",80,(o.lc*2+2)).line_wrap - filename_fictionbook.puts %{#{space*o.lc}</title>} + filename_fictionbook.puts %{#{spaces*o.lc}</title>} h=o.lc elsif o.is ==:heading_insert \ and o.obj =~/Endnotes/ \ @@ -338,40 +338,40 @@ module SiSU_XML_Fictionbook x=[] case h when 0 - x << "#{space*0}</#{tags.fictionbook[0]}>" if (lc <= 0) + x << "#{spaces*0}</#{tags.fictionbook[0]}>" if (lc <= 0) when 1 - x << "#{space*1}</#{tags.fictionbook[1]}>" if (lc <= 1) - x << "#{space*0}</#{tags.fictionbook[0]}>" if (lc <= 0) + x << "#{spaces*1}</#{tags.fictionbook[1]}>" if (lc <= 1) + x << "#{spaces*0}</#{tags.fictionbook[0]}>" if (lc <= 0) when 2 - x << "#{space*2}</#{tags.fictionbook[2]}>" if (lc <= 2) - x << "#{space*1}</#{tags.fictionbook[1]}>" if (lc <= 1) - x << "#{space*0}</#{tags.fictionbook[0]}>" if (lc <= 0) + x << "#{spaces*2}</#{tags.fictionbook[2]}>" if (lc <= 2) + x << "#{spaces*1}</#{tags.fictionbook[1]}>" if (lc <= 1) + x << "#{spaces*0}</#{tags.fictionbook[0]}>" if (lc <= 0) when 3 - x << "#{space*3}</#{tags.fictionbook[3]}>" if (lc <= 3) - x << "#{space*2}</#{tags.fictionbook[2]}>" if (lc <= 2) - x << "#{space*1}</#{tags.fictionbook[1]}>" if (lc <= 1) - x << "#{space*0}</#{tags.fictionbook[0]}>" if (lc <= 0) + x << "#{spaces*3}</#{tags.fictionbook[3]}>" if (lc <= 3) + x << "#{spaces*2}</#{tags.fictionbook[2]}>" if (lc <= 2) + x << "#{spaces*1}</#{tags.fictionbook[1]}>" if (lc <= 1) + x << "#{spaces*0}</#{tags.fictionbook[0]}>" if (lc <= 0) when 4 - x << "#{space*4}</#{tags.fictionbook[4]}>" if (lc <= 4) - x << "#{space*3}</#{tags.fictionbook[3]}>" if (lc <= 3) - x << "#{space*2}</#{tags.fictionbook[2]}>" if (lc <= 2) - x << "#{space*1}</#{tags.fictionbook[1]}>" if (lc <= 1) - x << "#{space*0}</#{tags.fictionbook[0]}>" if (lc <= 0) + x << "#{spaces*4}</#{tags.fictionbook[4]}>" if (lc <= 4) + x << "#{spaces*3}</#{tags.fictionbook[3]}>" if (lc <= 3) + x << "#{spaces*2}</#{tags.fictionbook[2]}>" if (lc <= 2) + x << "#{spaces*1}</#{tags.fictionbook[1]}>" if (lc <= 1) + x << "#{spaces*0}</#{tags.fictionbook[0]}>" if (lc <= 0) when 5 - x << "#{space*5}</#{tags.fictionbook[5]}>" if (lc <= 5) - x << "#{space*4}</#{tags.fictionbook[4]}>" if (lc <= 4) - x << "#{space*3}</#{tags.fictionbook[3]}>" if (lc <= 3) - x << "#{space*2}</#{tags.fictionbook[2]}>" if (lc <= 2) - x << "#{space*1}</#{tags.fictionbook[1]}>" if (lc <= 1) - x << "#{space*0}</#{tags.fictionbook[0]}>" if (lc <= 0) + x << "#{spaces*5}</#{tags.fictionbook[5]}>" if (lc <= 5) + x << "#{spaces*4}</#{tags.fictionbook[4]}>" if (lc <= 4) + x << "#{spaces*3}</#{tags.fictionbook[3]}>" if (lc <= 3) + x << "#{spaces*2}</#{tags.fictionbook[2]}>" if (lc <= 2) + x << "#{spaces*1}</#{tags.fictionbook[1]}>" if (lc <= 1) + x << "#{spaces*0}</#{tags.fictionbook[0]}>" if (lc <= 0) when 6 - x << "#{space*6}</#{tags.fictionbook[6]}>" if (lc <= 6) - x << "#{space*5}</#{tags.fictionbook[5]}>" if (lc <= 5) - x << "#{space*4}</#{tags.fictionbook[4]}>" if (lc <= 4) - x << "#{space*3}</#{tags.fictionbook[3]}>" if (lc <= 3) - x << "#{space*2}</#{tags.fictionbook[2]}>" if (lc <= 2) - x << "#{space*1}</#{tags.fictionbook[1]}>" if (lc <= 1) - x << "#{space*0}</#{tags.fictionbook[0]}>" if (lc <= 0) + x << "#{spaces*6}</#{tags.fictionbook[6]}>" if (lc <= 6) + x << "#{spaces*5}</#{tags.fictionbook[5]}>" if (lc <= 5) + x << "#{spaces*4}</#{tags.fictionbook[4]}>" if (lc <= 4) + x << "#{spaces*3}</#{tags.fictionbook[3]}>" if (lc <= 3) + x << "#{spaces*2}</#{tags.fictionbook[2]}>" if (lc <= 2) + x << "#{spaces*1}</#{tags.fictionbook[1]}>" if (lc <= 1) + x << "#{spaces*0}</#{tags.fictionbook[0]}>" if (lc <= 0) end x.join("\n") end |