aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v6/txt_shared.rb9
-rw-r--r--lib/sisu/v6/xml_docbook5.rb4
-rw-r--r--lib/sisu/v6/xml_shared.rb3
3 files changed, 10 insertions, 6 deletions
diff --git a/lib/sisu/v6/txt_shared.rb b/lib/sisu/v6/txt_shared.rb
index 8d2a09b7..3159844f 100644
--- a/lib/sisu/v6/txt_shared.rb
+++ b/lib/sisu/v6/txt_shared.rb
@@ -62,8 +62,8 @@
=end
module SiSU_TextUtils
class Wrap
- def initialize(para='',n_char_max=76,n_indent=0,n_hang=nil)
- @para,@n_char_max,@n_indent=para,n_char_max,n_indent
+ def initialize(para='',n_char_max=76,n_indent=0,n_hang=nil,post='')
+ @para,@n_char_max,@n_indent,@post,=para,n_char_max,n_indent,post
@n_char_max_extend = n_char_max
@n_hang=n_hang ? n_hang : @n_indent
end
@@ -110,7 +110,10 @@ module SiSU_TextUtils
end
@oldword=word if word =~/\S+/
end
- spaces_hang + out.join(spaces_indent)
+ post=(@post.empty?) \
+ ? ''
+ : "\n" + (' '*@n_indent) +@post
+ spaces_hang + out.join(spaces_indent) + post
end
def line_wrap_indent1
@n_indent,@n_hang=2,2
diff --git a/lib/sisu/v6/xml_docbook5.rb b/lib/sisu/v6/xml_docbook5.rb
index a835288a..3f5333b2 100644
--- a/lib/sisu/v6/xml_docbook5.rb
+++ b/lib/sisu/v6/xml_docbook5.rb
@@ -200,7 +200,7 @@ module SiSU_XML_Docbook_Book
data.each_with_index do |o,i|
if (defined? o.ocn and not o.ocn.nil?)
ocn=(@make.build.ocn?) \
- ? "\n#{Dx[:ocn_o]}#{o.ocn}#{Dx[:ocn_c]}"
+ ? "<!-- o#{o.ocn} -->"
: ''
id=%{ id="o#{o.ocn}" }
else
@@ -221,7 +221,7 @@ module SiSU_XML_Docbook_Book
#{spaces*o.lc}<title#{id}>
}
end
- filename_docbook.puts SiSU_TextUtils::Wrap.new(o.obj + ocn,80,(@splv*2+2)).line_wrap
+ filename_docbook.puts SiSU_TextUtils::Wrap.new(o.obj,80,(@splv*2+2),nil,ocn).line_wrap
filename_docbook.puts %{#{spaces*o.lc}</title>}
h=o.lc
elsif (o.of ==:para or o.of ==:block)
diff --git a/lib/sisu/v6/xml_shared.rb b/lib/sisu/v6/xml_shared.rb
index 033659f0..aeb73f22 100644
--- a/lib/sisu/v6/xml_shared.rb
+++ b/lib/sisu/v6/xml_shared.rb
@@ -460,7 +460,8 @@ module SiSU_XML_Munge
clean(str)
end
def markup_docbook(dob='') # work on, initially a copy of fictionbook!
- dob.obj=dob.obj.gsub(/#{Mx[:en_a_o]}(.+?)#{Mx[:en_a_c]}/m,'<footnote>\1</footnote>').
+ dob.obj=dob.obj.gsub(/#{Mx[:en_a_o]}(\d+)\s*(.+?)#{Mx[:en_a_c]}/m,'<footnote><para><!-- fn\1 -->\2</para></footnote>').
+ gsub(/\\\\/,'</para><para>').
gsub(/&/,'&amp;'). #sort
gsub(/#{Mx[:mk_o]}#([a-zA-Z]+)#{Mx[:mk_c]}/,'&\1;').
gsub(/(^|#{Mx[:gl_c]}|\s)&\s+/,'\1&amp; '). #sort