aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-07-26 20:27:58 -0400
committerRalph Amissah <ralph@amissah.com>2011-07-26 20:27:58 -0400
commit392f8d5cc7b48dfe27eb1c1034b04e899a54f7bf (patch)
tree02080bd6114078e960c2fef081ba94ea330b3ad8
parentv3: xhtml, xml sax & dom, indent (partially implemented) ... (diff)
v3: html, indent ...
-rw-r--r--data/doc/sisu/CHANGELOG_v34
-rw-r--r--lib/sisu/v3/html_scroll.rb20
-rw-r--r--lib/sisu/v3/html_segments.rb20
3 files changed, 28 insertions, 16 deletions
diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3
index 8d50ee88..29f166dd 100644
--- a/data/doc/sisu/CHANGELOG_v3
+++ b/data/doc/sisu/CHANGELOG_v3
@@ -26,8 +26,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.14.orig.tar.gz
_[0-9]?_[1-9] initial indent; paragraph text indent
- * done: dal, plaintext, css, xhtml, xml sax, xml dom;
- not done: html, epub, pdf, odf, man, info
+ * done: dal, plaintext, css, html, xhtml, xml sax, xml dom;
+ not done: epub, pdf, odf, man, info
check: po4a, html_lite (used in sql search results)
* syntax highlighting done: vim (sisu.vim), emacs (sisu-mode.el)
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'