summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* specify option ordering in the DESCRIPTION section;Ingo Schwarze2015-11-051-0/+5
| | | | from guenther@, ok and tweaks jmc@
* If a .Bd block has no arguments at all, drop the block and only keepIngo Schwarze2015-10-305-0/+20
| | | | | its contents. Removing a gratuitious difference to groff output found after a related bug report from krw@.
* Do not access a NULL pointer when a .Bd macro has no arguments at all.Ingo Schwarze2015-10-301-0/+3
| | | | Bug reported by krw@.
* apply bold and italic to all non-ASCII Unicode codepoints,Ingo Schwarze2015-10-231-1/+1
| | | | fixing input like \fB\('e; issue reported by bentley@
* use the new function man_validate() here, tooIngo Schwarze2015-10-224-3/+9
|
* move man(7) validation into the dedicated validation phase, tooIngo Schwarze2015-10-228-55/+63
|
* If no output device was allocated because no file wanted to produce output,Ingo Schwarze2015-10-221-15/+17
| | | | | refrain from dereferencing a NULL pointer during final deallocation. Fixing a recent regression reported by czarkoff@
* Move all mdoc(7) node validation done before child parsingIngo Schwarze2015-10-214-273/+245
| | | | | | to the new separate validation pass, except for a tiny bit needed by the parser which goes to the new mdoc_state() module; cleaner, simpler, and surprisingly also shorter by 15 lines.
* In order to become able to generate syntax tree nodes on the roff(7)Ingo Schwarze2015-10-2014-170/+381
| | | | | | | | level, validation must be separated from parsing and rewinding. This first big step moves calling of the mdoc(7) post_*() functions out of the parser loop into their own mdoc_validate() pass, while using a new mdoc_state() module to make syntax tree state handling available to both the parser loop and the validation pass.
* style cleanup, no functional changeIngo Schwarze2015-10-191-55/+58
|
* Simplify, no functional change:Ingo Schwarze2015-10-191-35/+51
| | | | Delete the outmdoc, outman, and outfree function pointers.
* including <ohash.h> requires including <stdint.h> beforehand;Ingo Schwarze2015-10-191-0/+1
| | | | noticed by Svyatoslav Mishyn <juef at openmailbox dot org>
* Very tricky diff to fix macro interpretation and spacing around tabsIngo Schwarze2015-10-174-42/+79
| | | | | | | | | | | | | | in .Bl -column; it took me more than a day to get this right. Triggered by a loosely related bug report from tim@. The lesson for you is: Use .Ta macros in .Bl -column, avoid tabs, or you are in for surprises: The last word before a tab is not interpreted as a macro (unless there is a blank in between), the first word after a tab isn't either (unless there is a blank in between), and a blank after a tab causes a leading blank in the respective output cell. Yes, "blank", "tab", "blank tab" and "tab blank" all have different semantics; if you write code relying on that, good luck maintaining it afterwards...
* Delete two preprocessor constants that are no longer used.Ingo Schwarze2015-10-152-5/+0
| | | | Patch from Michael Reed <m dot reed at mykolab dot com>.
* Simplify the part of args() that is handling .Bl -column phrases:Ingo Schwarze2015-10-151-72/+27
| | | | | | | | | | Delete manual "Ta" handling because macro handling should not be done in an argument parser but should be left to the macro parsers, which exist anyway and work well. No functional change, minus 40 lines of code. Confusing and redundant code found while investigating an old bug report from tim@.
* When blk_full() handles an .It line in .Bl -column and indirectlyIngo Schwarze2015-10-151-0/+5
| | | | | | | | calls phrase_ta() to handle a .Ta child macro, advance the body pointer accordingly, such that a subsequent tab character rewinds the right body block and doesn't fail an assertion. That happened when there was nothing between the .Ta and the tab character. Bug reported by tim@ some time ago.
* Reject the escape sequences \[uD800] to \[uDFFF] in the parser.Ingo Schwarze2015-10-131-0/+3
| | | | | | | These surrogates are not valid Unicode codepoints, so treat them just like any other undefined character escapes: Warn about them and do not produce output. Issue noticed while talking to stsp@, semarie@, and bentley@.
* Major character table cleanup:Ingo Schwarze2015-10-1322-632/+469
| | | | | | | | | | | | | * Use ohash(3) rather than a hand-rolled hash table. * Make the character table static in the chars.c module: There is no need to pass a pointer around, we most certainly never want to use two different character tables concurrently. * No need to keep the characters in a separate file chars.in; that merely encourages downstream porters to mess with them. * Sort the characters to agree with the mandoc_chars(7) manual page. * Specify Unicode codepoints in hex, not decimal (that's the detail that originally triggered this patch). No functional change, minus 100 LOC, and i don't see a performance change.
* Reduce the amount of code by moving the three copies of the ohashIngo Schwarze2015-10-137-131/+109
| | | | | callback functions into one common place, preparing for the use of ohash for some additional purposes. No functional change.
* Delete an assignment that is unconditionally overwritten two lines later;Ingo Schwarze2015-10-121-1/+0
| | | | | found by Svyatoslav Mishyn <juef at openmailbox dot org> with the clang static analyzer.
* Garbage collect an unused variable, no functional change;Ingo Schwarze2015-10-121-3/+2
| | | | found by Svyatoslav Mishyn <juef at openmailbox dot org> with cppcheck.
* Check the right pointer against NULL;Ingo Schwarze2015-10-121-1/+1
| | | | | fixing a pasto introduced in the previous commit; found by Svyatoslav Mishyn <juef at openmailbox dot org> with cppcheck.
* Use "-" rather than "\(hy" for the heads of .Bl -dash and -hyphen lists.Ingo Schwarze2015-10-121-1/+1
| | | | | | | In UTF-8 output, that renders as ASCII HYPHEN-MINUS (U+002D) rather than HYPHEN (U+2010), which looks better and matches groff. In ASCII output, it makes no difference. Suggested by naddy@.
* Clear dform and dsec when exiting a first-level directory in treescan().Ingo Schwarze2015-10-121-19/+22
| | | | | Fixes a segfault reported by bentley@. While here, do some style cleanup in the same function.
* Fix an obvious bug found during the /* FALLTHROUGH */ cleanup:Ingo Schwarze2015-10-121-1/+1
| | | | ASCII_NBRSP has to be rendered as "&nbsp;", not "-".
* To make the code more readable, delete 283 /* FALLTHROUGH */ commentsIngo Schwarze2015-10-1221-287/+5
| | | | | | that were right between two adjacent case statement. Keep only those 24 where the first case actually executes some code before falling through to the next case.
* Drop tags containing a blank character:Ingo Schwarze2015-10-111-1/+1
| | | | | | They don't work, they break other tags in weird ways, and even if they could be made to work, they would be mostly useless. Issue reported by naddy@, thanks.
* Finally use __progname, err(3) and warn(3).Ingo Schwarze2015-10-1114-130/+250
| | | | | | | | | | That's more readable and less error-prone than fumbling around with argv[0], fprintf(3), strerror(3), perror(3), and exit(3). It's a bad idea to boycott good interfaces merely because standards committees ignore them. Instead, let's provide compatibility modules for archaic systems (like commercial Solaris) that still don't have them. The compat module has an UCB Copyright (c) 1993...
* Mention that the first argument of .Pf does not need escaping.Ingo Schwarze2015-10-111-4/+8
| | | | | While here, make the first sentence regarding .Pf more concise. OK jmc@
* Decide whether to use_pager as early as possible,Ingo Schwarze2015-10-101-3/+5
| | | | in preparation for pledge(2); no functional change intended.
* modernize style: "return" is not a functionIngo Schwarze2015-10-0665-878/+882
|
* improve wording and start a new sentence on a new line; from jmc@Ingo Schwarze2015-10-061-2/+3
|
* Theo found a stray blank in HTML output.Ingo Schwarze2015-09-291-0/+6
|
* briefly document -T tree outputIngo Schwarze2015-09-261-0/+40
|
* Show the flags MDOC_DELIMO, MDOC_DELIMC, MDOC_EOS, and MAN_EOS.Ingo Schwarze2015-09-261-7/+17
| | | | Drop the "block-" prefixes from the node type names.
* /* NOTREACHED */ after abort() is silly, delete itIngo Schwarze2015-09-2614-28/+2
|
* resolve code duplication and do style cleanup in mdoc_nm_pre(),Ingo Schwarze2015-09-261-8/+4
| | | | no functional change
* Fix multiple aspects of SYNOPSIS .Nm formatting:Ingo Schwarze2015-09-261-2/+3
| | | | | | * Don't break lines before non-block .Nm elements. * Use proper <b> markup for the heads of .Nm blocks. * Make the width measurements work by doing them on the head children.
* typos; found and fixed by sobrado@Ingo Schwarze2015-09-242-6/+6
|
* Trailing whitespace is significant when determining the width of a tagIngo Schwarze2015-09-214-10/+17
| | | | | in mdoc(7) .Bl -tag and man(7) .TP, but not in man(7) .IP. Quirk reported by Jan Stary <hans at stare dot cz> on ports@.
* no more _subdir; Jan Stary <hans at stare dot cz>Ingo Schwarze2015-09-211-18/+0
|
* for portability, use (char *)NULL in execlp(3) as discussed on tech@ OpenBSDIngo Schwarze2015-09-161-2/+2
| | | | (didn't blow up anywhere yet, but better safe than sorry)
* Avoid .Ns right after .Pf, it's pointless.Ingo Schwarze2015-09-141-1/+1
|
* Remove the warning about children of .Vt blocks because actually,Ingo Schwarze2015-09-144-33/+1
| | | | | | | .Vt type global_variable No = Dv defined_constant ; is the best way to specify in the SYNOPSIS how a global variable is initialized in the rare case where that matters. Issue noticed by jmc@.
* The .Dv macro actually forces normal font.Ingo Schwarze2015-09-141-1/+1
|
* Fill mode changes don't break next-line scope in all cases,Ingo Schwarze2015-09-042-2/+16
| | | | | | in particular not for tagged paragraphs. Issue found by Christian Neukirchen <chneukirchen at gmail dot com> in the exiv2(1) manual page.
* Recommend an unambiguous escape for minus signs instead of \-.Ingo Schwarze2015-09-021-5/+5
| | | | | | | | | | | | | | | | | | | | | | Historically, \- was used in troff for three cases: flags/pathnames, en dashes, and minus signs. mandoc_char(7) currently recommends it for minus signs, recommends \(en for en dashes, and doesn't mention flags/pathnames. In the old days, nroff rendered \- as ASCII '-', and troff rendered it as en dash/minus (which were visually indistinguishable). In Unicode, en dashes and minus signs are semantically distinct and encoded differently (U+2013 for en dash, U+2212 for minus), and often rendered differently too. Meanwhile ASCII '-' has been renamed "hyphen-minus" and fonts typically render it closest to a hyphen, not a minus. There is very little consistency across roff implementations and output formats for what Unicode character \- corresponds to. So at least for minus signs, change the recommendation to the unambiguous \(mi escape. from bentley@, ok jmc@ (after reams of discussion)
* Drop leading, internal, and trailing blank characters in \o (overstrike)Ingo Schwarze2015-08-301-1/+7
| | | | | | escape sequences; that's cleaner for all output modes, and it's required to prevent the PostScript/PDF formatter from dying on assertions. Bug found by jsg@ with afl.
* If an .Fo macro lacks its mandatory argument, don't die on an assertion.Ingo Schwarze2015-08-301-3/+2
| | | | Bug found by jsg@ with afl.
* If we have to reparse the text line because we spring an input line trap,Ingo Schwarze2015-08-291-16/+17
| | | | | | we must not escape breakable hyphens yet, or mparse_buf_r() in read.c will complain and replace the escaped hyphens with question marks. Bug found in ocserv(8) following a report from Kurt Jaeger <pi at FreeBSD>.