From 727db14c20acedb648b127976e6e0ed104d8515a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 26 Jul 2011 20:28:55 -0400 Subject: v3: epub, indent ... --- lib/sisu/v3/epub_segments.rb | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'lib/sisu/v3/epub_segments.rb') diff --git a/lib/sisu/v3/epub_segments.rb b/lib/sisu/v3/epub_segments.rb index 7bddf917..b9b75b9c 100644 --- a/lib/sisu/v3/epub_segments.rb +++ b/lib/sisu/v3/epub_segments.rb @@ -360,8 +360,11 @@ WOK @p_num=SiSU_EPUB_Format::Paragraph_number.new(@md,dob.ocn) end sto=SiSU_EPUB_Format::Format_text_object.new(@md,dob) - dob_xhtml=if dob.is=='heading' or dob.is=='heading_insert' or dob.is=='para' - dob_xhtml=if dob.is=='heading' or dob.is=='heading_insert' + dob_xhtml=if dob.is=='heading' \ + or dob.is=='heading_insert' \ + or dob.is=='para' + dob_xhtml=if dob.is=='heading' \ + or dob.is=='heading_insert' if dob.ln==4 sto.seg_heading4 # work on see Split_text_object elsif dob.ln==5 @@ -369,16 +372,23 @@ WOK elsif dob.ln==6; sto.seg_heading6 end elsif dob.is=='para' - if dob.indent and dob.indent =~/[1-9]/ + if dob.indent \ + and dob.hang \ + and dob.indent =~/[0-9]/ \ + and dob.hang =~/[0-9]/ if dob.bullet_ - sto.format('li',"i#{dob.indent}") - else sto.format('p',"i#{dob.indent}") - end - else - if dob.bullet_ - sto.format('li','bullet') + if dob.indent =~/[1-9]/ + sto.format('li',"i#{dob.indent}") + else + sto.format('li','bullet') + end + elsif dob.indent == dob.hang + sto.format('p',"i#{dob.indent}") + elsif dob.indent != dob.hang + sto.format('p',"h#{dob.hang}i#{dob.indent}") else sto.para end + else sto.para end end elsif dob.is =~/^(?:block|group|alt)$/ -- cgit v1.2.3