aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v2/odf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v2/odf.rb')
-rw-r--r--lib/sisu/v2/odf.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/sisu/v2/odf.rb b/lib/sisu/v2/odf.rb
index 2c0e206b..bb071683 100644
--- a/lib/sisu/v2/odf.rb
+++ b/lib/sisu/v2/odf.rb
@@ -113,9 +113,8 @@ module SiSU_ODF
@vz=SiSU_Env::Get_init.instance.skin
@tab="\t"
@brace_url=SiSU_Viz::Skin.new.url_decoration
- @br=if @md.cmd =~/M/; "\n"
- else ''
- end
+ @br=(@md.cmd =~/M/) ? '' : ''
+ #@br=(@md.cmd =~/M/) ? "\n" : ''
end
def songsheet
pre
@@ -316,9 +315,15 @@ module SiSU_ODF
end
if str
@astx||=10000
+ @astxs||=20000
if str =~/#{Mx[:en_a_o]}\d+\s+/
str.gsub!(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/,'<text:note text:id="ftn\1" text:note-class="footnote"><text:note-citation>\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>')
end
+ if str =~/#{Mx[:en_a_o]}([*]+)\s+/
+ a=$1.gsub(/([*])/,"\\\\\\1")
+ str.gsub!(/#{Mx[:en_a_o]}([*]+)\s+(.+?)#{Mx[:en_a_c]}/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>})
+ @astxs+=1
+ end
if str=~/#{Mx[:en_a_o]}[*+]+\s/
asterisk=str.scan(/#{Mx[:en_a_o]}([*+]+)\s+(.+?)#{Mx[:en_a_c]}/)
asterisk.each do |x|
@@ -459,6 +464,7 @@ module SiSU_ODF
or w =~/&nbsp;/
w.gsub!(/&/,'&amp;') #watch &nbsp;
end
+ w.gsub!(/(&\S{1,7};)+&/,'\1&amp;') #could break things
end
para_array << w
end
@@ -466,8 +472,8 @@ module SiSU_ODF
dob.obj=dob.obj.strip
end
if dob.is=='code' #{Mx[:gr_o]}code#{Mx[:gr_c]}/ #fix #code-block: angle brackets special characters #fix
- dob.obj.gsub!(/(^|[^}])_</m,'\1&lt;'); dob.obj.gsub!(/(^|[^}])_>/m,'\1&gt;')
- dob.obj.gsub!(/(^|[^}])_</m,'\1&lt;'); dob.obj.gsub!(/(^|[^}])_>/m,'\1&gt;')
+ dob.obj.gsub!(/(^|[^}])_(?:<|&lt;)/m,'\1&lt;'); dob.obj.gsub!(/(^|[^}])_(?:>|&gt;)/m,'\1&gt;')
+ dob.obj.gsub!(/(^|[^}])_(?:<|&lt;)/m,'\1&lt;'); dob.obj.gsub!(/(^|[^}])_(?:>|&gt;)/m,'\1&gt;')
end
if dob.of=='group'
dob.obj.gsub!(/#{Mx[:gl_bullet]}/,'● ')