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.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/sisu/v2/odf.rb b/lib/sisu/v2/odf.rb
index 769870eb..d19945c0 100644
--- a/lib/sisu/v2/odf.rb
+++ b/lib/sisu/v2/odf.rb
@@ -411,6 +411,18 @@ module SiSU_ODF
end
dob
end
+ def obj_break(dob)
+ if dob.is =='break'
+ br=SiSU_ODF_format::Format_obj_break.new(@md,dob)
+ if dob.obj==Mx[:br_page] \
+ or dob.obj==Mx[:br_page_new]
+ dob=br.br_page
+ elsif dob.obj==Mx[:obj_ln_sep]
+ dob=br.obj_sep
+ end
+ end
+ dob
+ end
def odf_structure(md,dob)
@md,@dob=md,dob
dob=if dob.is !='code'
@@ -431,6 +443,8 @@ module SiSU_ODF
@@odf[:body] << code(dob).obj << @br*2
elsif dob.is=='table' #elsif dob.obj =~ /<!Th?¡/u
@@odf[:body] << table(dob).obj << @br*2
+ elsif dob.is=='break'
+ @@odf[:body] << obj_break(dob).obj << @br*2
else
@@odf[:body] << normal(dob).obj << @br*2 # main text, contents, body KEEP
end
@@ -492,8 +506,6 @@ module SiSU_ODF
dob.obj
end
dob.obj.gsub!(/#{Mx[:br_line]}/,'<br />')
- dob.obj.gsub!(/#{Mx[:br_page]}|#{Mx[:br_page_new]}/,
- '<text:p text:style-name="P8"> </text:p>')
dob.obj.gsub!(/&#169;/,'©') #too arbitrary
dob.obj.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check
dob.obj.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,
@@ -517,7 +529,6 @@ module SiSU_ODF
dob.obj.gsub!(/\\copy(?:right)?\b/,'&#169;')
dob.obj.gsub!(/\\trademark\b|\\tm\b/,'&#174;')
dob.obj.gsub!(/\44/,'&#36;') #$ watch
- dob.obj.gsub!(/#{Mx[:br_page]}|#{Mx[:br_page_new]}/,'') # remove page breaks
dob.obj.gsub!(/<a href=".+?">(.+?)<\/a>/,'\1')
dob.obj.gsub!(/#{Mx[:mk_o]}name#\S+?#{Mx[:mk_c]}/,'') # remove name links
wordlist=dob.obj.scan(/\S+/)
@@ -528,7 +539,7 @@ module SiSU_ODF
if defined? dob.ocn and dob.ocn =~/\d+/
@p_num=SiSU_ODF_format::Paragraph_number.new(dob.ocn)
end
- if dob.is=~/heading|para|group|verse|code|table/ # extend, include other types
+ if dob.is=~/heading|para|group|verse|code|table|break/ # extend, include other types
odf_structure(@md,dob)
end
dob.obj.gsub!(/<!.+!>/,' ') if dob.obj ## Clean Prepared Text