summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Document the "delim" syntax and its usage.Ingo Schwarze2020-01-101-22/+29
| | | | | | | Closing a gap reported by bentley@, who also sent a patch, but i'm explaining it somewhat differently. While here, remove duplicate information from the text. OK bentley@
* Skip whitespace before tokens, too.Ingo Schwarze2020-01-085-5/+33
| | | | Bug found by bentley@ with input like "delim $$ delim off".
* Improve the test case by changing the eqn(7) delimiters such that itIngo Schwarze2020-01-082-7/+7
| | | | | actually tests which parts of text lines are processed with eqn(7) and which are not.
* Enable generation of the desired delim/basic output with groff(1).Ingo Schwarze2020-01-081-1/+3
| | | | No functional change for the portable test suite.
* Simplify maintainer targets in OpenBSD: EQN and TBL variablesIngo Schwarze2020-01-085-29/+8
| | | | | | no longer exist and NROFF/NOPTS were replaced with GROFF/GOPTS. This doesn't change how things work in the protable version of the test suite.
* Improve the description of -m/-M/MANPATH/man.conf in multiple respectsIngo Schwarze2020-01-071-33/+46
| | | | | | after kn@ reported that the descriptions were incomplete and somewhat inaccurate. OK jmc@ kn@
* When all cells in a tbl(1) column are empty, set the column widthIngo Schwarze2019-12-314-7/+114
| | | | | to 1n rather than to 0n, in the same way as groff does. This fixes misformatting reported by bentley@ in xkeyboard-config(7).
* Do not fail an assertion when a high level macro occurs in the bodyIngo Schwarze2019-12-261-1/+13
| | | | | | | of a conditional inside a .ce request block. Instead, abort the .ce block just like when there is no conditional in between. Bug found by espie@ working on the textproc/fstrcmp port.
* distinction between .Vt and .VaIngo Schwarze2019-12-251-0/+5
|
* two new entries: make .Sh/.Ss parsed in mdoc(7)Ingo Schwarze2019-12-221-0/+8
| | | | and delete release number verification from groff_mdoc(7)
* In HTML, display straight quotes, not curly quotes, for Qq/Qo/Qc macros.Ingo Schwarze2019-12-111-3/+7
| | | | | | This is the intended behavior and already the case in terminal output. Incorrect output noticed by Eldred Habert. Patch from bentley@.
* Add a Content-Security-Policy HTTP header that allows only CSS.Ingo Schwarze2019-11-101-0/+2
| | | | | | This ensures that in a modern browser that understands the header, mandoc rendering bugs cannot possibly be interpreted as JavaScript. Patch from bentley@.
* want to get rid of the last style= attributes, suggested by bentley@Ingo Schwarze2019-11-101-0/+5
|
* .ce .if .B crash reported by espie@, and one other bugIngo Schwarze2019-11-091-0/+13
|
* In the past, generating comment nodes stopped at the .TH or .DdIngo Schwarze2019-11-092-3/+8
| | | | | | | | | | | macro, which is usually close to the beginning of the file, right after the Copyright header comments. But espie@ found horrible input files in the textproc/fstrcmp port that generate lots of parse nodes before even getting to the header macro. In some formatters, comment nodes after some kinds of real content triggered assertions. So make sure generation of comment nodes stops once real content is encountered.
* draft 1.14.6 release notesIngo Schwarze2019-10-131-0/+82
|
* For invalid queries and for valid queries returning no result,Ingo Schwarze2019-10-011-7/+10
| | | | | | return the appropriate 40x status code rather than 200. Improvement suggested and diff tested by John Gardner <gardnerjohng at gmail dot com>.
* Fix line breaking in no-fill mode (.Bd -unfilled/<pre>),Ingo Schwarze2019-09-151-20/+26
| | | | | | | | | | | | | which apparently didn't work since the .Pp/<p> reorg. The new logic is more similar to what the terminal formatter does: 1. Before a node that starts a new mdoc(7) input line, start a new HTML output line. 2. An empty input line or a .Pp causes an empty output line. 3. Nothing needs to be done at the end of a node. Severe misformatting was reported in table(5) by Edgar Pettijohn <edgar at pettijohn dash web dot com> on misc@.
* Improve validation of function names:Ingo Schwarze2019-09-135-8/+74
| | | | | | 1. Relax checking to accept function types of the form "ret_type (fname)(args)" (suggested by Yuri Pankov <yuripv dot net>). 2. Tighten checking to require the closing parenthesis.
* adapt to print_indent() HTML_NOSPACE fix, html.c rev. 1.261Ingo Schwarze2019-09-052-18/+6
|
* Do not clear HTML_NOSPACE in print_indent().Ingo Schwarze2019-09-051-7/+4
| | | | | | | | | | | | | | | | I don't think there ever was a reason for doing so. Besides, there is a discrepacy with respect to the point in the document affected. That flag controls whitespace at the current formatting point. But when HTML_BUFFER is in effect, the line break and indentation is typically inserted one word further to the left. Anything happening at that point to the left can't reasonably influence spacing at the different point further to the right. Among other effects, this change avoids some spurious line breaks in HTML code at points where they weren't supposed to happen, line breaks that in some cases caused undesirable, visible whitespace when the resulting HTML was rendered.
* adapt to new <p> output logic (html.c rev. 1.260)Ingo Schwarze2019-09-0327-78/+29
|
* Wrap text and phrasing elements in paragraphs unless alreadyIngo Schwarze2019-09-031-1/+24
| | | | | | | | | contained in flow containers; never put them directly into sections. This helps to format paragraphs with the CSS class selector .Pp. Suggested by bentley@ and also by Colin Watson <cjwatson at debian> via Michael Stapelberg <stapelberg at debian>, see https://github.com/Debian/debiman/issues/116
* Format .Nd with more logically with <span> rather than <div>; after all,Ingo Schwarze2019-09-031-3/+1
| | | | | | | | | | it is supposed to be a one-line description. For the case where .Nd generates flow content (which is very bad style but syntactically valid), rely on the new feature of html_close_paragraph() to close out the <span> prematurely, effectively moving the flow content out of the .Nd for HTML presentation. For the final closing, also rely on the new html_close_paragraph() functionality, this time triggered by the subsequent block, which will typically be .Sh SYNOPSIS.
* Make html_close_paragraph() more versatile, more robust, lessIngo Schwarze2019-09-031-13/+10
| | | | | | | | dependent on individual HTML elements, and simpler: don't just close <p>, <pre>, and <a>, but any element that establishes phrasing context. This doesn't change output for any OpenBSD manual page, but it will allow using this function more safely and at more places in the future.
* delete the TAG_IDIV crutch, which is no longer usedIngo Schwarze2019-09-013-3/+1
|
* In the HTML formatter, assert(3) that no HTML nesting violation occurs.Ingo Schwarze2019-08-292-38/+50
| | | | | | | Tested on the complete manual page trees of Version 7 AT&T UNIX, 4.4BSD-Lite2, POSIX-2013, OpenBSD 2.2 to 6.5 and -current, FreeBSD 10.0 to 12.0, NetBSD 6.1.5 to 8.1, DragonFly 3.8.2 to 5.6.1, and Linux 4.05 to 5.02.
* minor sync of the inline stylesheet with mandoc.css:Ingo Schwarze2019-08-021-11/+6
| | | | delete unimportant .Pp rule and shorten overly specific selectors
* Simplification, no functional change:Ingo Schwarze2019-07-281-36/+29
| | | | | | Delete the "argc" argument from fs_search() which is now always 1, and move error reporting to the main() program where it is more logically placed and easier to see.
* There is no point in pledge(2)ing literally the same list twice,Ingo Schwarze2019-07-281-16/+0
| | | | so delete the second copy. No functional change.
* In man(1) mode, do the search for each name independently, andIngo Schwarze2019-07-281-81/+79
| | | | | | | | show the results in the order of the command line arguments. Implemented by separating the code for man(1) and apropos(1) in the main() program. Surprisingly, the number of lines of code remains unchanged. Issue reported by deraadt@, additional input from millert@.
* Improve structure, no functional change:Ingo Schwarze2019-07-281-80/+90
| | | | | Unify code to process one single input file and move it into a dedicated new function.
* Move two more output state variables into the new struct outstate.Ingo Schwarze2019-07-273-29/+26
| | | | | Also, move setting of tag_files.tagname into tag_init(). No functional change.
* Cleanup, no functional change:Ingo Schwarze2019-07-261-59/+61
| | | | | | For clarity, stop storing the same information (in this case, -O settings) in two structs. Give the local struct in main.c a more descriptive name (output state).
* Structural cleanup, no functional change:Ingo Schwarze2019-07-261-37/+43
| | | | | | | | Mixing parser and formatter state in the same struct was a bad idea, so pull the parser state and configuration out of it. This makes sure output options are not passed into parser functions and parser options are not passed into output functions. While here, add comments to the important local variables in main().
* Structural cleanup, no functional change:Ingo Schwarze2019-07-261-54/+60
| | | | | Move process group management out of main() into its own function because it has its own, self-contained logic and its own local variables.
* tagging support for .TP and .TQ; try e.g. man -O tag=commit cvsIngo Schwarze2019-07-231-0/+12
|
* Slowly start implementing tagging support for man(7) pages, evenIngo Schwarze2019-07-223-4/+67
| | | | | | | | | | | | | though it is obvious that this can never become as good as for mdoc(7) pages. As a first step, tag alphabetic arguments of .IP macros, which are often used for lists of options and keywords. Try "man -O tag=g as" to get the point. Thanks to Leah Neukirchen for recently reminding me that exploring how much can be done in this respect may be worthwhile: it is likely to slightly improve usability while adding only small amounts of relatively straightforward code.
* If no tags were generated at all, unlink(2) the empty tags file asIngo Schwarze2019-07-192-3/+12
| | | | | | | | | | | | soon as the condition can be detected and do not pass it to less(1). This may happen for man(7) pages, for preformatted pages, and for very simple pages like true(1). The main benefit is that :t inside less(1) yields the clearer diagnostic message "No tags file" rather than the mildly confusing "No such tag in tags file": the latter might encourage further, futile attempts to jump to other tags. Improvement suggested by Leah Neukirchen <leah at vuxu dot org> from The Void.
* new test for an empty text block; from rea@ via bapt@ (FreeBSD)Ingo Schwarze2019-07-183-2/+44
|
* don't print the final heads-up about messagesIngo Schwarze2019-07-151-1/+2
| | | | | when a search did not yield any manual pages to display; issue found with regress/usr.bin/mandoc/db/
* explain escaping of end-of-sentence characters;Ingo Schwarze2019-07-152-0/+13
| | | | missing info reported by Ian <ropers at gmail dot com> on misc@
* If messages are shown and output is printed without a pager, displayIngo Schwarze2019-07-143-1/+13
| | | | | | | | | | a heads-up on stderr at the end because otherwise, users may easily miss the messages: because messages typically occur while parsing, they typically preceed the output. This is most useful with flag combinations like "-c -W all" but may also help in some unusual error scenarios. Inconvenient ordering of output originally pointed out by espie@ for the example situation that /tmp/ is not writeable.
* When parsing a tab character that is not preceded by a space characterIngo Schwarze2019-07-115-6/+8
| | | | | | | | | | | | | | | | on an .It -column line, args() sets the MDOC_PHRASEQL flag to Quote the Last word of the Phrase. Even if it turns out this quoting is not needed because the word is already quoted for other reasons, clear the flag at the end of parsing the phrase, such that the flag does not leak to the next phrase. This patch fixes the bug that the trailing Macro on a line of the form .It "word<tab>word" Ta word Macro<eol> was incorrectly considered quoted and hence not parsed. Bug found by Havard Eidnes (he@) with the NetBSD gettytab(5) manual page: https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54361 Reported via Thomas Klausner (wiz@).
* Some time ago, i simplified mandoc_msg() such that it can be usedIngo Schwarze2019-07-108-241/+338
| | | | | | | | | everywhere and not only in the parsers. For more uniform messages, use it at more places instead of err(3), in particular in the main program. While here, integrate a few trivial functions called at exactly one place into the main option parser, and let a few more functions use the normal convention of returning 0 for success and -1 for error.
* in man.cgi(8), disable -O toc by default; requested by deraadt@Ingo Schwarze2019-07-101-1/+0
|
* The non-standard .EX/.EE macro pair was invented for Version 9 AT&T UNIXIngo Schwarze2019-07-091-4/+8
| | | | | | and only got adopted by GNU two decades later. Thanks to Doug McIlroy <doug at cs dot dartmouth dot edu> for pointing out the error.
* prevent mandoc from segfaulting if /tmp is not writable;Ingo Schwarze2019-07-061-2/+4
| | | | patch from espie@
* use the standard spelling of the word "idiosyncrasy";Ingo Schwarze2019-07-011-1/+1
| | | | suggested by Michal Nowak <mnowak at startmail dot com>
* delete trailing whitespace and space-tab sequences; no code change;Ingo Schwarze2019-07-0110-12/+12
| | | | | patch from Michal Nowak <mnowak at startmail dot com> who found these with git pbchk in the illumos tree