summaryrefslogtreecommitdiff
path: root/regress/usr.bin/mandoc
AgeCommit message (Collapse)Author
2013-01-05In literal mode (.nf), each input line must be kept togetherIngo Schwarze
on the same output line, even if it is longer than the output width. This commit fixes a bug allowing an overly long last line of an indented block (.RS) to be broken even in literal mode. The bug was found using the sudo_plugin(4) manual provided by millert@. I introduced the bug in rev. 1.84 during the g2k12 Budapest hackathon.
2012-12-31Rewrite indentation handling for nested lists in a more systematic wayIngo Schwarze
to fix multiple issues reported by Todd Miller; thanks! Specifically, - avoid double indentation after .Bd inside .Bl - set up correct indentation after .Bl inside .Bl - set up correct indentation after .Dl and .D1 inside .Bl While here, also - set up correct indentation *inside* .Dl and .D1 inside .Bl.
2012-11-19Do not crash on stray .Ta macros found outside column lists.Ingo Schwarze
Problem reported by jmc@, thanks.
2012-11-19In -Tman mode, support automatic word keeps in the SYNOPSISIngo Schwarze
just like in -Tascii mode; requested by millert@. While here, do not escape the blank characters terminating man(7) macros; this is becoming more important as we use more keeps now. Note that -Tman still does not support .nr nS.
2012-11-18Check that mandoc handles non-numeric width argumentsIngo Schwarze
to .Bl -tag and .TP the same way as groff, even via -Tman. Some time ago, millert@ reported issues with these; apparently, those issues were fixed since then.
2012-11-18Correct indentation for lists and displays inside lists.Ingo Schwarze
Inspired by a diff from millert@, but implemented rather differently and with slightly better functionality. In particular, this one respects -offset and -width arguments found in the input file.
2012-11-18Test paragraph distance (.PD) implementation;Ingo Schwarze
related to man_term.c rev. 1.88, man_validate.c rev. 1.56.
2012-11-18Fix four small whitespace issues related to trailing punctuationIngo Schwarze
reported by Nicolas Joly <njoly at pasteur dot fr>: - add EOS spacing after trailing punctuation after .Cd, .Fc, and .Lb - suppress spacing before trailing punctuation after .Fd
2012-11-16Two more macros (.Ap and .In) do trailing delimiter handling.Ingo Schwarze
This fixes the end of sentence spacing in open(2) and in about 150 pages in the NetBSD base system. Reported by Nicolas Joly <njoly a pasteur point fr>, merci!
2012-11-16Improve formatting of badly nested font blocks.Ingo Schwarze
The basic idea is to already pop the font at the end marker instead of allowing it to linger until the final end of the block. This requires a few preliminaries: * For each block, save a pointer to the previous font to be used in case the block breaks another and gets extended. * That requires making node information writable during rendering. * Now fonts may get popped in the wrong order; hence, after the stack has already been rewound further by some block that began earlier, ignore popping a font that was put on the stack later. * To be able to exploit all this for font blocks, tie processing to their body, not their block, which is more logical anyway. Triggered by florian@ reporting vaguely similar issues with list blocks.
2011-12-04test some simple macros; written while working on -TmanIngo Schwarze
2012-11-16Fix a crash triggered by .Bl -tag .It Xo .El .Sh found by florian@.Ingo Schwarze
* When allocating a body end marker, copy the pointer to the normalized block information from the body block, avoiding the risk of subsequent null pointer derefence. * When inserting the body end marker into the syntax tree, do not try to copy that pointer from the parent block, because not being a direkt child of the block it belongs to is the whole point of a body end marker. * Even non-callable blocks (like Bd and Bl) can break other blocks; when this happens, postpone closing them out in the usual way.
2012-07-29in addition to backslash-tilda,Ingo Schwarze
test the more portable backslash-space as well
2012-07-18enable more tests, some were forgotten along the wayIngo Schwarze
2012-07-18Drop empty .IP such that is does not cause additional vertical spacing.Ingo Schwarze
Issue first reported by naddy@ in rsync(1).
2012-07-18Drop .sp and .br right after .SH and .SS.Ingo Schwarze
Fixes vertical spacing after "OPTIONS" in gcc(1). Issue first reported by naddy@ in rsync(1).
2012-07-18Let a trailing .Ns macro take effectIngo Schwarze
even on an input line containing a partial implicit macro. Fixes horizontal spacing in vi(1), ddb(4), and ppp(8).
2012-07-18Fix handling of paragraph macros inside lists:Ingo Schwarze
* When they are trailing the last item, move them outside the list. * When they are trailing any other none-compact item, drop them. Improves formatting of 40 pages, e.g. grep(1), ksh(1), netstat(1), ath(4), bsd.port.mk(5), pf.conf(5), mount(8), crypto(9).
2012-07-18The mdoc(7) \*(Ba predefined string actually forces roman font;Ingo Schwarze
that's stupid because it may break enclosing font changes, but let's do the same for groff bug compatibility. --> Never use \*(Ba, use just plain "|"! <-- Also, predefined strings are already expanded by the roff(7) parser, so the mdoc(7) parser has to look for the expanded string. Formatting improvements in ksh(1), less(1), atan2(3), hostapd.conf(5), snmpd.conf(5), and mknod(8).
2012-07-16Release polishing: finally fix the perl(1) SYNOPSIS.Ingo Schwarze
In flush-left mode of both man(7) and mdoc(7), when an output line is broken at the position of a literal tab, the tab indents the following line. Reminded by deraadt@ in Pest, Ujlipotvaros, Csanady utza.
2012-07-16test end-of-sentence handlingIngo Schwarze
2012-07-16some more whitespace tests found in my treeIngo Schwarze
2012-07-16Several -mdoc parser improvements related to vertical spacing:Ingo Schwarze
* So far, .Pp and .Lp were removed before paragraph type blocks. * Now also remove .br before paragraph type blocks. * Treat .Lp as a paragraph like .Pp, so remove .Pp, .Lp, .br before it. * Do not treat .sp as a paragraph, don't remove anything before it. * After .Sh, .Ss, .Pp, and .Lp, remove .Pp, .Lp, .sp, .br, and blank lines. * After .sp and .br, remove .br.
2012-07-14Translate blank input lines to .sp just like in mdoc(7),Ingo Schwarze
and ignore .sp after .PP. This fixes vertical spacing for blank lines after .PP and for .sp after .PP.
2012-07-13If the tag in .Bl -tag .It would leave exactly one blank before theIngo Schwarze
body of the item, mdoc(7) breaks the line, whereas the .TP used to translate this to man(7) does not. Thus, insert an explicit roff(7) line break in this place. To be able to correctly count the characters, do not pass font escapes an the like through print_word().
2012-07-13In -man -Tascii, support .sp with negative argument.Ingo Schwarze
In -mdoc -Tman, improve the framework to control vertical spacing. Use both to support .Bl -compact (surprisingly hard to get right).
2012-07-12regression tests related to mdoc_validate rev. 1.105Ingo Schwarze
2012-07-12test .Fn with exactly one argument;Ingo Schwarze
forgotten when committing mdoc_man.c rev. 1.33
2012-07-12Do not crash in -Tman on:Ingo Schwarze
* .Fn with exactly one argument * .Bl -hang without a -width Now all 3776 base manuals build without crashing.
2012-07-11Polish -Tman .Rs support.Ingo Schwarze
All mdoc(7) macros are now supported by -Tman.
2012-07-11fix position and formatting of %UIngo Schwarze
2012-07-10basic implementation of -Tman .Bl -tagIngo Schwarze
while here, do some minor outflags cleanup
2012-07-10multiple fixes to -Tascii .HP rendering:Ingo Schwarze
* do not add an excessive blank line before the block * in literal mode, start a new line after the tag getting this to work requires some general (print_man_node) fixes: * in literal mode, break the output line at the end of each input line, not just after those input lines ending in text * but don't break it when there was no output on the line * and adjust the margins after the .HP tag these general fixes require an adjustment to -Tascii .TP rendering: * set up NOBREAK mode before the body, not after the head finally, based on all this, implement -Tman .Bl -hang in terms of .HP
2012-07-10test vertical spacing around filling macros;Ingo Schwarze
forgot to commit on June 2 after implementing .EX
2012-07-10Remove a hack that was intended for groff-1.15 bug compatibility:Ingo Schwarze
When the width of a tag in .Bl -hang was exactly one character shorter than the maximum length that would fit, the following text would have a negative hang of one character (i.e., hang to the left). That bug is no longer present in groff-1.21, so relax mandoc, too.
2012-07-10* implement -Tman .Bl -item -inset -diag -ohang -dash -hyphen -enum .ItIngo Schwarze
* fix -Tman .Bl -bullet .It * adjust the -Tascii .Bl -bullet -dash -hyphen .It default and minimum width to new groff standards, it changed from 4n (in groff 1.15) to 2n (in groff 1.21) * same for -Tascii -enum, it changed from 5n to 2n * use -hang formatting for -Tascii -enum -width 2n * for -Tascii -enum, the default is -width 3n
2012-07-09fix -Tascii .Fd line breakingIngo Schwarze
and implement -Tman .Fd
2012-07-09implement -Tman .Eo and .EcIngo Schwarze
2012-07-09Implement -Tman .Bf.Ingo Schwarze
To get the spacing right, * avoid man(7) code line breaks at places where no spacing is allowed * allow spacing right after .Sm on * allow spacing after empty .Fl at the end of an input line
2012-07-09fix -Tman font handling for:Ingo Schwarze
.Ad .Ar .Cd .Cm .Dv .Em .Er .Ev .Fa .Fl .Fn .Fo .Ft .Ic .In .Lk .Li .Ms .Mt .Nm .Pa .Sx .Sy .Tn .Va .Vt
2012-07-09implement -Tman .No and .MtIngo Schwarze
2012-07-08fix .Lk for -Tascii and implement it for -TmanIngo Schwarze
2012-07-08fix vertical spacing for -Tman SYNOPSIS .Fn .Fo .Ft .In .Nm .Va .VtIngo Schwarze
2012-07-08implement -Tman .AnIngo Schwarze
also reset -[no]split mode at .Sh AUTHORS in -Tascii
2012-07-08implement -Tman .VtIngo Schwarze
2012-07-07Support the .cc request; code by kristaps@, tests by me.Ingo Schwarze
Needed for sqlite3(1) as reported by espie@.
2012-07-07Add a test for RS breaking some other block.Ingo Schwarze
Unfortunately, the code triggering the assert fixed in man_macro.c rev. 1.37 must be commented out because groff misformats the invalid input so badly that imitating it really makes no sense.
2012-07-07after several improvements to -Tman went in,Ingo Schwarze
enable lots of related regression tests
2012-06-02In groff, trying to redefine standard man(7) macros before .TH has no effect;Ingo Schwarze
after .TH, it works. Trying to redefine standard mdoc(7) macros before .Dd works when calling groff with the -mdoc command line option, but does not when calling groff with -mandoc; after .Dd, it always works. Arguably, one might call that buggy behaviour in groff, but it is very unlikely that anybody will change groff in this respect (certainly, i'm not volunteering). So let's be bug-compatible. This fixes the vertical spacing in sox(1).
2012-06-02Minimal implementation of .EX and .EE for GNU compatibility.Ingo Schwarze
Do not use this, it is not portable and only defined in esr's man-ext. For example, sox(1) wants these macros.