aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/epub_segments.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/epub_segments.rb')
-rw-r--r--lib/sisu/v3/epub_segments.rb28
1 files changed, 19 insertions, 9 deletions
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)$/