summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
AgeCommit message (Collapse)Author
2014-11-18Ignore invalid directories in man.conf(5) and MANPATH, even if theirIngo Schwarze
parent directories exist, but complain about invalid directories given on the command line. Intended to fix an oddity reported by sthen@.
2014-11-18In man(1) mode, prefer file name matches over .Dt name matches overIngo Schwarze
first .Nm entries over other NAME .Nm entries over SYNOPSIS .Nm entries. For example, this makes sure "man ypbind" does not return yp(8). Re-run "makewhatis" to profit from this change.
2014-11-17Multiple fixes with respect to in-line macros:Ingo Schwarze
* .No selects the default font; relevant e.g. in .Bf blocks * no need to force empty .Li elements * closing delimiters as leading macro arguments do not suppress space * opening delimiters at the end of a macro line do not suppress space * correctly handle delimiter spacing in -Tman As a side effect, these fixes let mandoc warn about empty .No macros as requested by bentley@.
2014-11-16When a line (in the sense of term_flushln()) contains white space only,Ingo Schwarze
the `vbl' variable includes the left margin, but `vis' does not. Prevent a `vis' underflow that caused a bogus blank line. Bug reported by Carsten Kunze, found in less(1): .Bl -tag ... .It " "
2014-11-16Delete five standards that are:Ingo Schwarze
* not supported by groff * not used in any OpenBSD, NetBSD, DragonFly or FreeBSD base manual * superseded or retracted * and more than ten years old Triggered by a question from Carsten Kunze (Heirloom troff). OK guenther@ jmc@
2014-11-14Remove needless and harmful byte swapping on big endian architectures.Ingo Schwarze
Problem found and patch provided by Martin Natano at bitrig, thanks! Tested on macppc by natano@ and on i386, amd64, and sparc64 myself.
2014-11-11In man(1) mode without -a, stop searching after the first manual treeIngo Schwarze
that contained at least one match in order to not prefer mdoc(1) from ports over mdoc(7). As a bonus, this results in a speedup.
2014-11-11Let -h imply -c (that is, not use the pager).Ingo Schwarze
Usually, -h output is short, so the pager is just a nuisance. Also, traditional man(1) does not use a pager for -h. Triggered by a remark of deraadt@ on ICB.
2014-11-11implement -h (synopsis only) for preformatted (cat) pages;Ingo Schwarze
requested by tedu@
2014-11-10add required vertical spacing before lists that beginIngo Schwarze
at the beginning of the first item of an enclosing list right at the beginning of a new section or subsection; minibug reported by Steffen Nurpmeso <sdaoden at yandex dot com>
2014-11-06Let -Tascii \(bu (bullet) output agree with groff;Ingo Schwarze
this is now possible because -Tps now handles backspace overstriking.
2014-11-03Allow the five man(7) font macros to concatenate their line arguments,Ingo Schwarze
the same way the mdoc(7) macros marked MDOC_JOIN do it. In -Thtml, this removes bogus <br/> when the font macros are used in no-fill mode; issue found by jsg@ in the Xcursor(3) SYNOPSIS. As a bonus, this slightly reduces the size of the syntax tree.
2014-11-01Use struct buf in libroff, it is very natural thereIngo Schwarze
and reduces the number of arguments of many functions. While here, sprinkle some KNF. No functional change.
2014-11-01Refactor, no functional change: Remove the parse point from struct buf.Ingo Schwarze
Some functions need multiple parse points, some none at all, and it varies whether any of them need to be passed around. So better pass them as a separate argument, and only when needed.
2014-11-01fix a typo causing crashes in Unicode string length measurementIngo Schwarze
2014-10-30Major bugsquashing with respect to -offset and -width:Ingo Schwarze
1. Support specifying the .Bd and .Bl -offset as a macro default width; while here, simplify the code handling the same for .Bl -width. 2. Correct handling of .Bl -offset arguments: unlike .Bd -offset, the arguments "left", "indent", and "indent-two" have no special meaning. 3. Fix the scaling of string length -offset and -width arguments in -Thtml. Triggered by an incomplete documentation patch from bentley@.
2014-10-30mandoc.1: fix a macro error in previousJason McIntyre
main.c: add -K to usage() and wrap nicely ok schwarze
2014-10-30support UTF-8 and ISO-8859-1 input by integrating modified partsIngo Schwarze
of kristaps@' version of the preconv(1) utility into mandoc(1); positive feedback from bentley@ and no concern raised when shown on tech@
2014-10-29Some fine tuning of console rendering of named special characters.Ingo Schwarze
Correct ASCII rendering: \(lb \(<> \(sd Make ASCII rendering agree with groff, using backspace overstrike: \(da \(ua \(dA \(uA \(fa \(c* \(c+ \(ib \(ip \(/_ \(pp \(is \(dd \(dg
2014-10-29In terminal output, unify handling of Unicode and numbered characterIngo Schwarze
escape sequences just like it was earlier implemented for -Thtml. Do not let control characters other than ASCII 9 (horizontal tab) propagate to the output, even though groff allows them; but that really doesn't look like a great idea. Let mchars_num2char() return int such that we can distinguish invalid \N syntax from \N'0'. This also reduces the danger of signed char issues popping up.
2014-10-28In -Tascii mode, print "<?>" only for Unicode escapes of unknownIngo Schwarze
representation, not for character escapes with unknown names. According to groff, the latter produce no output, and we now warn about them.
2014-10-28Make the character table available to libroff so it can check theIngo Schwarze
validity of character escape names and warn about unknown ones. This requires mchars_spec2cp() to report unknown names again. Fortunately, that doesn't require changing the calling code because according to groff, invalid character escapes should not produce output anyway, and now that we warn about them, that's fine.
2014-10-28Tighten Unicode escape name parsing.Ingo Schwarze
Accept only 0xXXXX, 0xYXXXX, 0x10XXXX with Y != 0. This simplifies mchars_num2uc().
2014-10-28Refine -Tascii rendering of Unicode characters, mostly to better agreeIngo Schwarze
with groff, in particular in cases where groff uses backspace overstrike. In two cases, agreement is impossible because groff clobbers the previous line: \(*G \(*S In a number of cases, groff rendering is so misleading that i chose to render differently: \(Sd \(TP \(Tp \(Po \(ps \(sc \(r! \(r? \(de While here, also correct the \(la and \(ra Unicode code points.
2014-10-27Support overstriking by backspace in PostScript and PDF output.Ingo Schwarze
Of course, this is only a minor improvement; it would be much better to support non-ASCII characters in these output modes, but that would require major changes that i'm not going to work on right now. The main reason for doing this is that it allows to get ASCII output closer to groff.
2014-10-27Handle output encoding for unicode, numbered and named escape sequencesIngo Schwarze
in one common, safe way instead of three different ways. In particular, * skip NUL, it is used to mean "no output desired" * deny 0x01-0x1F and 0x7F-0x9F, print REPLACEMENT CHARACTER instead * print 0x20-0x7E literally or name-encoded, as required * print characters above 0x9F numerically
2014-10-27Fix a regression in term.c rev. 1.89 reported by bentley@:Ingo Schwarze
In UTF-8 output, do not print anything if mchars_spec2cp() returns 0. In particular, this repairs handling of zero-width spaces (\&). While here, let mchars_spec2cp() return 0xFFFD instead of -1 if the character is not found, simplifying the using code. In HTML output, do not print obfuscated ASCII characters and do not test for one-char escapes, mchars_spec2cp() already does that.
2014-10-26In -Tascii mode, provide approximations even for some Unicode escapeIngo Schwarze
sequences above codepoint 512 by doing a reverse lookup in the existing mandoc_char(7) character table. Again, groff isn't smart enough to do this and silently discards such escape sequences without printing anything.
2014-10-26Improve -Tascii output for Unicode escape sequences: For the first 512Ingo Schwarze
code points, provide ASCII approximations. This is already much better than what groff does, which prints nothing for most code points. A few minor fixes while here: * Handle Unicode escape sequences in the ASCII range. * In case of errors, use the REPLACEMENT CHARACTER U+FFFD for -Tutf8 and the string "<?>" for -Tascii output. * Handle all one-character escape sequences in mchars_spec2{cp,str}() and remove the workarounds on the higher level.
2014-10-25With the current architecture, we can't support inline equationsIngo Schwarze
inside tables, sorry. So don't even try to parse tbl(7) blocks for eqn(7) delimiters. Broken table layout found in glPixelMap(3) while investigating a bug report by Theo Buehler <theo at math dot ethz dot ch>.
2014-10-25Fix a NULL pointer dereference reportedIngo Schwarze
by Theo Buehler <theo at math dot ethz dot ch> on tech@: Do not attempt to parse empty equations.
2014-10-25Report arguments to .EQ as an error, and simplify the code:Ingo Schwarze
* drop trivial wrapper function roff_openeqn() * drop unused first arg of function eqn_alloc() * drop usused member "name" of struct eqn_node
2014-10-20protect the roff parser from dividing by zero;Ingo Schwarze
issue found and patch written by kristaps@
2014-10-20correct the spacing after in-line equationsIngo Schwarze
that start at the beginning of an input line but end before the end of an input line
2014-10-20correctly parse spacing around in-line equationsIngo Schwarze
at the beginning and at the end of input lines; issue reported by kristaps@
2014-10-20correct spacing *after* inline equations (much simpler than expected)Ingo Schwarze
2014-10-20correct spacing before inline equationsIngo Schwarze
2014-10-20show the {MDOC,MAN}_EQN node, it contains interesting information,Ingo Schwarze
in particular line and column numbers and flags; but hide the uninteresting EQN_ROOT box
2014-10-18plug file descriptor leaks on read or write failure;Ingo Schwarze
hinted at by Steffen Nurpmeso <sdaoden at yandex dot com>.
2014-10-16oops, don't escape the first token of inline equationsIngo Schwarze
2014-10-16Implement in-line equations, much needed by Xenocara manuals.Ingo Schwarze
Put the steering into the roff parser rather than into the mdoc parser such that it works for all macro languages and on both text and macro lines. Line breaks and blank characters generated before and after in-line equations are not perfect yet, but let's do one thing at a time.
2014-10-14even if a table has zero columns, do not segfault in the formatter;Ingo Schwarze
bug reported by bentley@
2014-10-14Rudimentary implementation of the e, x, and z table layout modifiersIngo Schwarze
to equalize, maximize, and ignore the width of columns. Does not yet take vertical rulers into account, and does not do line breaks within table cells. Considerably improves the lftp(1) manual; issue noticed by sthen@.
2014-10-13implement font modifiers in table layoutsIngo Schwarze
2014-10-13Properly scale string length measurements for PostScript and PDF output;Ingo Schwarze
this doesn't change anything for ASCII and UTF-8. Problem reported by bentley@.
2014-10-13Add missing */ after $OpenBSD$ tagCharles Longeau
ok schwarze@
2014-10-13Stricter syntax checking of Unicode character names:Ingo Schwarze
Require exactly 4, 5 or 6 hex digits and allow nothing else. This avoids mishandling stuff like \[ua] and \C'uA' as Unicode and also fixes underlining in eqn(7) -Thtml output which uses \[ul]. Problem found and semantics suggested by kristaps@.
2014-10-13Do not warn about declarations of functions returning function pointers,Ingo Schwarze
getting rid of a false positive noticed by bentley@.
2014-10-12add missing entry for .ll to the dispatch table;Ingo Schwarze
patch from Martin <Natano at natano dot net>, thanks
2014-10-12bugfix: do not parse quoted strings for tokens; fixes glFrustum(3)Ingo Schwarze