[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] fix groff_www TTY output to preserve indent for .ULS/.OLS/.DLS
From: |
Julien Moutinho |
Subject: |
[PATCH] fix groff_www TTY output to preserve indent for .ULS/.OLS/.DLS |
Date: |
Fri, 24 Aug 2012 19:55:52 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi there!
I guess groff's www.tmac should preserve better indentation,
here is a small patch I wrote for that:
% diff -Nru old/groff new/groff
diff -Nru old/groff/1.21/tmac/www.tmac new/groff/1.21/tmac/www.tmac
--- old/groff/1.21/tmac/www.tmac 2012-08-24 18:18:07.221698823 +0200
+++ new/groff/1.21/tmac/www.tmac 2012-08-24 19:09:33.029669397 +0200
@@ -1008,6 +1008,7 @@
.
.\" which macro to use for LI
.de www-push-li
+. nr www-li-indent \\n[.i]
. nr www-depth +1
. ds www-level\\n[www-depth] \\$1\"
. ds www-ltag\\n[www-depth]
% cat test/t.1
.Dd August 24, 2012
.Dt T \&1 "T"
.Os
.Sh NAME
. Nm T
. Nd t
.Sh Sh0
blah
. Ss Ss0
ULS
. ULS
. LI
LI
. LI
LI
. ULE
ULE
. Ss Ss1
ULS
. ULS
. LI
LI
. LI
LI
. ULE
ULE
. Ss Ss2
OLS
. OLS
. LI
LI
. LI
DLS
. DLS
. LI TERM
LI
. LI TERM
LI
. DLE
DLE
. LI
LI
. OLE
OLE
% groffer --mode tty -Tutf8 -Kutf8 -mdoc -M /tmp/old/groff/1.21/tmac -mwww
test/t.1
T(1) T T(1)
NAME
T — t
Sh0
blah
Ss0
ULS
· LI
· LI
ULE
Ss1
ULS
· LI
· LI
ULE
Ss2
OLS
1 LI
2 DLS
TERM
LI
TERM
LI
DLE
3 LI
OLE
BSD August 24, 2012 BSD
% groffer --mode tty -Tutf8 -Kutf8 -mdoc -M /tmp/new/groff/1.21/tmac -mwww
test/t.1
T(1) T T(1)
NAME
T — t
Sh0
blah
Ss0
ULS
· LI
· LI
ULE
Ss1
ULS
· LI
· LI
ULE
Ss2
OLS
1 LI
2 DLS
TERM
LI
TERM
LI
DLE
3 LI
OLE
BSD August 24, 2012 BSD
By the way, the XHTML output suffers a problem too:
% groffer --mode www -Txhtml -Kutf8 -mdoc -M /tmp/new/groff/1.21/tmac -mwww
test/t.1 | xmllint - 2>&1 | grep mismatch
-:55: parser error : Opening and ending tag mismatch: li line 55 and p
-:58: parser error : Opening and ending tag mismatch: p line 57 and dl
-:58: parser error : Opening and ending tag mismatch: dl line 55 and li
-:58: parser error : Opening and ending tag mismatch: p line 55 and ol
-:58: parser error : Opening and ending tag mismatch: ol line 53 and p
Looks like a problem due to the handling of \X^html</p>: by grohtml(1).
And fist of all there seems to be an inconsistency between .ULE and .OLE
where .HTML</p> is used for the former but .HTML for the latter.
Hope this helps.
--julm
- [PATCH] fix groff_www TTY output to preserve indent for .ULS/.OLS/.DLS,
Julien Moutinho <=