From 392f8d5cc7b48dfe27eb1c1034b04e899a54f7bf Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 26 Jul 2011 20:27:58 -0400 Subject: v3: html, indent ... --- lib/sisu/v3/html_scroll.rb | 20 +++++++++++++------- lib/sisu/v3/html_segments.rb | 20 +++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v3/html_scroll.rb b/lib/sisu/v3/html_scroll.rb index d58dd502..0a37bcca 100644 --- a/lib/sisu/v3/html_scroll.rb +++ b/lib/sisu/v3/html_scroll.rb @@ -153,16 +153,22 @@ module SiSU_HTML_scroll end elsif dob.is=='para' if dob.indent \ - and dob.indent =~/[1-9]/ + 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 elsif dob.is=='block' sto.block diff --git a/lib/sisu/v3/html_segments.rb b/lib/sisu/v3/html_segments.rb index ccd48407..e6dc0d35 100644 --- a/lib/sisu/v3/html_segments.rb +++ b/lib/sisu/v3/html_segments.rb @@ -389,16 +389,22 @@ module SiSU_HTML_seg end elsif dob.is=='para' if dob.indent \ - and dob.indent =~/[1-9]/ + 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' -- cgit v1.2.3