Ingo Schwarze [Fri, 3 May 2019 18:17:12 +0000 (18:17 +0000)]
Enter dangling .so links into the database, to avoid harassing
users of man(1) about running makewhatis(8), which won't help.
Seeing the content of the broken .so request might even help
users to figure out how to access the manual page they want.
Fixing the last issue reported by Lorenzo Beretta <loreb at github>
as part of https://github.com/void-linux/void-packages/issues/9868 .
Ingo Schwarze [Fri, 3 May 2019 17:31:15 +0000 (17:31 +0000)]
In fs_lookup(), use stat(2) rather than access(2) to check file existence.
Some mildly broken real-world packages on some operating systems
contain dangling symlinks in manual page directories: pestering the
user to run makewhatis(8) makes no sense because that won't help.
On the other hand, missing read permissions deserve ugly error messages
and are unlikely to occur in practice anyway.
Fixing an issue reported by Lorenzo Beretta <loreb at github>
as part of https://github.com/void-linux/void-packages/issues/9868 .
Ingo Schwarze [Fri, 3 May 2019 16:14:41 +0000 (16:14 +0000)]
In man(1) mode with a specific section requested,
try harder to find the best match.
Use this order of preference:
1. The section in both the directory name and the file name matches exactly.
2. The section in the file name matches exactly.
3. The section in the directory name matches exactly.
4. Neither of them matches exactly.
The latter can happen when mansearch() finds substring matches
or when the second .Dt argument mismatches the dir and file names.
Lorenzo Beretta <loreb at github> reported that this caused real
problems on Void Linux, like "man 3 readline" showing readline(3m).
See https://github.com/void-linux/void-packages/issues/9868 for details.
Ingo Schwarze [Fri, 3 May 2019 09:39:25 +0000 (09:39 +0000)]
In man(1) mode, when the first argument starts with a digit,
optionally followed by a letter, and at least one more argument
follows, interpret the first argument as a section name even when
additional characters follow after the digit and letter.
This is needed because many operating systems have section names
consisting of a digit followed by more than one letter - for example
Illumos, Solaris, Linux, even NetBSD.
There is very little risk of regressions: in the whole corpus of
manual pages on man.openbsd.org, there isn't a single manual page
name starting with a digit. And even if programs like "0ad" or
"4channels" had manual pages, "man 0ad" and "man -a cat 0ad" would
still work, only "man -a 0ad cat" will fail with "man: No entry for
cat in section 0ad of the manual."
Fixing one of the issues reported by Lorenzo Beretta <loreb at github>
as part of https://github.com/void-linux/void-packages/issues/9868 .
In man(1) mode, i.e. when asking for a single manual page by name,
prefer file name matches over .Dt/.TH matches over first NAME matches
over later NAME matches, but do not change the ordering for apropos(1)
nor for man -a.
This reverts main.c rev. 1.310 and mansearch.h rev. 1.29
and includes a partial revert of mansearch.c rev. 1.79.
Regression reported by Lorenzo Beretta <loreb at github>
as part of https://github.com/void-linux/void-packages/issues/9868 .
In HTML output, allow switching the desired font for subsequent
text without printing an opening tag right away, and use that in
the .ft request handler. While here, garbage collect redundant
enum htmlfont and reduce code duplication in print_text().
Fixing an assertion failure reported by Michael <Stapelberg at Debian>
in pmRegisterDerived(3) from libpcp3-dev.
When calling an empty macro, do not clobber existing arguments.
Fixing a bug found with the groffer(1) version 1.19 manual page
following a report from Jan Stary.
Implement the roff .break request (break out of a .while loop).
Jan Stary <hans at stare dot cz> found it in an ancient groffer(1)
manual page (version 1.19) on MacOS X Mojave.
Having .break not implemented wasn't a particularly bright idea
because obviously, it tended to cause infinite loops.
Ingo Schwarze [Sun, 31 Mar 2019 19:17:26 +0000 (19:17 +0000)]
While we do encourage simplicity in the sense of writing plain '-'
for hyphen-minus, soften the language a bit: writing \- for it is
not wrong, and people started sending us patches to replace \- with '-'
in existing manual pages, which is not a worthwhile change unless
the \- is used at a place where it doesn't belong.
OK jmc@
Ingo Schwarze [Fri, 29 Mar 2019 21:27:06 +0000 (21:27 +0000)]
Set the maximum column index in a tbl(7) to the maximum *right* edge
of any cell span, not to the maximum *left* edge, which may be smaller
if the last column of the table is only reached by horizontal spans,
but not by any regular cell in any row of the table.
Otherwise, the algorithm calculating column widths accessed memomy
after the end of the colwidth[] array, while it was trying to handle
the rightmost column(s).
Crash reported by Jason Thorpe <thorpej at NetBSD>
via https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54069
and via Thomas Klausner (wiz@).
Christos@ Zoulas sent a (correct, but slightly confusing) patch.
The patch i'm committing here is easier to understand.
Ingo Schwarze [Tue, 19 Mar 2019 16:26:08 +0000 (16:26 +0000)]
When the last line of the input is empty and the previous line reduced
the line input buffer to a length of one byte, do not write one byte
past the end of the line input buffer. Minimal code to show the bug:
printf ".ds X\n.X\n\n" | MALLOC_OPTIONS=C mandoc
Bug found by bentley@ in the sysutils/rancid par(1) manual page.
Ingo Schwarze [Sun, 17 Mar 2019 18:21:45 +0000 (18:21 +0000)]
The header file "html.h" uses enum roff_tok,
so "roff.h" must be included before it.
Diff from bcallah@ tweaked by me;
he found the bug by compiling with pcc.
Ingo Schwarze [Sat, 16 Mar 2019 21:35:48 +0000 (21:35 +0000)]
When drawing a horizontal line in tbl(7) UTF-8 output, it is not
sufficient to look at two data rows, but up to three are needed:
the one above to identify vertical lines branching off upward, the
row itself (in case the line is in a data row rather than a layout
line) to figure out the horizontal line style, and the row below
to identify vertical lines branching off downward.
As an example, bentley@ reported from the mpv(1) manual page that
in a tbl(7) having a vertical line in the middle and a horizontal
line in the bottom data row, the vertical line extended below the
bottom horizontal line.
Ingo Schwarze [Wed, 13 Mar 2019 18:29:18 +0000 (18:29 +0000)]
Contrary to what the NetBSD attribute(3) manual page suggests,
using __dead instead of __attribute__((__noreturn__)) actually
hinders portability rather than helping it.
Given that mandoc already uses __attribute__ in several files
and that in the portable version, ./configure already contains
rudimentary support for ignoring it on platforms that do not
support it, use __attribute__ directly.
This is expected to fix build failures that Stephen Gregoratto
<dev at sgregoratto dot me> reported from Arch and Debian Linux.
Ingo Schwarze [Sun, 10 Mar 2019 09:23:33 +0000 (09:23 +0000)]
Automatically detect whether diff(1) supports the -a option.
Useful on illumos and on Oracle Solaris, where it doesn't.
Patch written based on a report from Sevan Janiyan.
Ingo Schwarze [Wed, 6 Mar 2019 10:18:58 +0000 (10:18 +0000)]
autoconfiguration test whether less(1) supports the -T option;
needed for Alpine Linux because it uses busybox less(1) by default;
based on a patch from Daniel Sabogal explained to me by Natanael Copa
Ingo Schwarze [Mon, 4 Mar 2019 18:15:06 +0000 (18:15 +0000)]
For TIOCGWINSZ, #include <termios.h> rather than <sys/termios.h>
like almost all other userland programs. This also improves
portability: for example, it looks like <sys/termios.h> does not
work on FreeBSD, or at least bapt@ did the same change over there.
Ingo Schwarze [Mon, 4 Mar 2019 13:01:57 +0000 (13:01 +0000)]
When the -S option is given to man(1) and the requested manual page
name is not found and the requested architecture is unknown, complain
about the architecture rather than about the manual page name:
$ man -S vax cpu
man: Unknown architecture "vax".
$ man -S sparc64 foobar
man: No entry for foobar in the manual.
Friendlier error message suggested by jmc@, who also OK'ed the patch.
Ingo Schwarze [Mon, 4 Mar 2019 11:40:09 +0000 (11:40 +0000)]
Fix the last straggler where the struct roff_node "line" member
was abused to detect an input line break;
instead, use the NODE_LINE flag to improve robustness.
Ingo Schwarze [Sun, 3 Mar 2019 13:02:11 +0000 (13:02 +0000)]
Reset HTML formatter state, in particular the id_unique hash,
after processing each manual page, such that the next page
starts from a clean state and doesn't continue suffix numbering.
Issue found while looking at https://github.com/Debian/debiman/issues/48
which was brought up by Orestis Ioannou <oorestisime at github>.
Ingo Schwarze [Sat, 2 Mar 2019 22:04:40 +0000 (22:04 +0000)]
Do not open a subsection for each and every macro.
Instead, use a tagged list and the canonical .Ic macro
as it is natural for such purposes.
While here, also delete heaps of needless escaping.
Ingo Schwarze [Sat, 2 Mar 2019 16:30:53 +0000 (16:30 +0000)]
Represent multiple subsequent .IP blocks having a consistent
head argument of *, \-, or \(bu as <ul> rather than as <dl>,
using a bit of heuristics.
Basic idea suggested by Dagfinn Ilmari Mannsaker <ilmari at github>
in https://github.com/Debian/debiman/issues/67 and independently by
<Pali dot Rohar at gmail dot com> on <discuss at mandoc dot bsd dot lv>.
Ingo Schwarze [Fri, 1 Mar 2019 10:57:17 +0000 (10:57 +0000)]
Wrap .Sh/.SH sections and .Ss/.SS subsections in HTML <section> elements
as recommended for accessibility by the HTML 5 standard.
Triggered by a similar, but slightly different suggestion
from Laura Morales <lauretas at mail dot com>.
Ingo Schwarze [Thu, 28 Feb 2019 16:36:13 +0000 (16:36 +0000)]
Format multiple subsequent .IP or multiple subsequent .TP/.TQ
as a single <dl> list rather than opening a new list for each item;
feature suggested by Pali dot Rohar at gmail dot com.
Ingo Schwarze [Sat, 23 Feb 2019 18:53:54 +0000 (18:53 +0000)]
Explain the ASCII rendering of single quotes because that repeatedly
caused confusion in the past. People plainly do not expect that
there are limits to the compatibility between Unicode and ASCII,
but there are.
The information belongs here and not into mandoc_char(7) because
it explains how the specific output device (-T ascii) works and
because it has nothing to do with the question of how characters
are represented on the input side.
Ingo Schwarze [Sat, 9 Feb 2019 21:02:47 +0000 (21:02 +0000)]
The horizontal line in a data cell containing only "_" or "="
connects to the horizontally adjacent vertical line or cell;
fixing a bug reported by bentley@.
Ingo Schwarze [Wed, 6 Feb 2019 22:18:59 +0000 (22:18 +0000)]
Remove the misleading statement ".No takes no arguments".
In facts, i works very similarly to .Em and .Sy.
Triggered by a question from Kurt Mosiejczuk <kurt at cranky dot work>.
Ingo Schwarze [Wed, 6 Feb 2019 21:11:43 +0000 (21:11 +0000)]
Let roff_getname() end the roff identifier at a tab character
and audit all its callers whether termination is handled correctly.
Resulting improvements:
* An escape or tab ending the macro name in a macro invocation
is discarded, and argument processing is started after it.
* An escape or tab ending a name in ".if d" and ".if r" is preserved.
* An escape ending a name in ".ds" causes the whole request to be ignored.
* A tab ending a name in ".ds" becomes part of the string.
* An escape or tab ending a name in ".rm"
causes the rest of the line to be ignored.
* An escape or tab ending the first name in ".als", ".rn", or ".nr"
causes the whole request to be ignored.
Kurt Jaeger <pi at FreeBSD> made me aware of
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235456#c0
and in that bug report, comment 0 item (3) is a special case
of this class of issues.
Yes, the "mh" manual pages are no doubt among the worst on the planet.
Ingo Schwarze [Thu, 31 Jan 2019 23:00:23 +0000 (23:00 +0000)]
Relax overzealous PATH_INFO validation.
URIs like https://man.openbsd.org/OpenBSD-2.2/cat1/cat.0
are still required to work because they result from apropos searches for
old releases (up to 5.0) which used to install preformatted manual pages.
Regression reported by jj@.
Ingo Schwarze [Thu, 31 Jan 2019 16:31:55 +0000 (16:31 +0000)]
Since resetting of offsets works quite differently in man(7) and mdoc(7),
test table centering in an mdoc(7) document as well.
Related to tbl_term.c rev. 1.67.
Ingo Schwarze [Thu, 31 Jan 2019 16:06:22 +0000 (16:06 +0000)]
Fix tbl(7) centering in mdoc(7) documents.
Since resetting of offsets works quite differently in the mdoc(7)
and man(7) formatters, the tbl(7) formatter needs to save the global
offset on entry and restore it on exit. The additional indentation
needed for table centering has to be added to its own offset variable
and applied to each line of the table, rather than only to the first.
Ingo Schwarze [Fri, 18 Jan 2019 14:36:21 +0000 (14:36 +0000)]
The .UR and .MT blocks in man(7) are represented by <a> elements
which establish phrasing context, but they can contain paragraph
breaks (which is relevant for terminal formatting, so we can't just
change the structure of the syntax tree), which are respresented
by <p> elements and cannot occur inside <a>.
Fix this by prematurely closing the <a> element in the HTML formatter.
This menas that the clickable text in HTML output is shorter than
what is represented as the link text in terminal output, but in
HTML, it is frankly impossible to have the clickable area of a
hyperlink extend across a paragraph break. The difference in
presentation is not a major problem, and besides, paragraph breaks
inside .UR are rather poor style in the first place.
The implementation is quite tricky. Naively closing out the <a>
prematurely would result in accessing a stale pointer when later
reaching the physical end of the .UR block. So this commit separates
visual and structural closing of "struct tag" stack items. Visual
closing means that the HTML element is closed but the "struct tag"
remains on the stack, to avoid later access to a stale pointer and
to avoid closing the same HTML element a second time later.
This also needs reference counting of pointers to "struct tag" stack
items because often more than one child holds a pointer to the same
parent item, and only the outermost child can safely do the physical
closing.
In the whole corpus of nearly half a million manual pages on
man.openbsd.org, this problem occurs in exactly one page: the
groff(1) version 1.20.1 manual contained in DragonFly-3.8.2, which
contains a formatting error triggering the bug.
Ingo Schwarze [Thu, 17 Jan 2019 08:14:38 +0000 (08:14 +0000)]
Delete several entries that were already fixed.
The two entries about dashes, hyphens, and minus signs are no longer
relevant because we decided on a policy that is now documented.
Ingo Schwarze [Tue, 15 Jan 2019 12:16:18 +0000 (12:16 +0000)]
In PostScript and PDF output, one AFM unit is not nearly enough
inter-word spacing, let's try again with 250 AFM units.
Regression caused during my recent term_flushln() reorg in rev. 1.278,
reported by brynet@ (sorry and many thanks for reporting).
Ingo Schwarze [Fri, 11 Jan 2019 17:04:44 +0000 (17:04 +0000)]
Improve error reporting when a file given on the command line
cannot be opened:
* Mention the filename.
* Report the errno for the file itself, not the one with .gz appended.
Ingo Schwarze [Fri, 11 Jan 2019 12:56:42 +0000 (12:56 +0000)]
Remove the HTML title= attributes which harmed accessibility and
violated the principle of separation of content and presentation.
Instead, implement the tooltips purely in CSS.
Thanks to John Gardner <gardnerjohng at gmail dot com> for
suggesting most of the styling in the new ::before rules.
Ingo Schwarze [Thu, 10 Jan 2019 07:40:10 +0000 (07:40 +0000)]
After years of gnashing of teeth, i finally found a way to avoid
having to write empty list elements for non-compact .Bl -tag lists:
1. Add margin-bottom to the <dd>.
Note that margin-top on the <dt> doesn't work because it would put
a short <dt> lower than the <dd>; margin-bottom on the <dt> doesn't
work because it would put vertical space before the <dd> for a long
<dt>; and margin-top on the <dd> doesn't work because it would put
a short <dt> higher than the <dd>. Only margin-bottom on the <dd>
has none of these adverse effects.
2. Of course, margin-bottom on the <dd> fails to take care of the
vertical spacing before the first list element, so implement that
separately by margin-top on the <dl>.
Ingo Schwarze [Thu, 10 Jan 2019 06:29:00 +0000 (06:29 +0000)]
Initializers for file-scope static variables should be compile-time
constants, and while stderr is a compile-time constant in OpenBSD,
Kelvin Sherlock <ksherlock at gmail dot com> reports that it isn't
on some other systems, for example on FreeBSD or Linux.
So do the initialization by calling mandoc_msg_setoutfile()
from main() instead.
Ingo Schwarze [Mon, 7 Jan 2019 07:26:29 +0000 (07:26 +0000)]
Represent mdoc(7) .Pp (and .sp, and some SYNOPSIS and .Rs features)
by the <p> HTML element and use the html_fillmode() mechanism
for .Bd -unfilled, just like it was done for man(7) earlier, finally
getting rid both of the horrible <div class="Pp"></div> hack and
of the worst HTML syntax violations caused by nested displays.
Care is needed because in some situations, paragraphs have to remain
open across several subsequent macros, whereas in other situations,
they must get closed together with a block containing them.
Some implementation details include:
* Always close paragraphs before emitting HTML flow content.
* Let html_close_paragraph() also close <pre> for extra safety.
* Drop the old, now unused function print_paragraph().
* Minor adjustments in the top-level man(7) node formatter for symmetry.
* Bugfix: .Ss heads suspend no-fill mode, even though .Ss doesn't end it.
* Bugfix: give up on .Op semantic markup for now, see the comment.
Ingo Schwarze [Sun, 6 Jan 2019 04:55:09 +0000 (04:55 +0000)]
Finally, represent the man(7) .PP and .HP macros by the natural
choice, which is the <p> HTML element. On top of the previous
fill-mode improvements, the key to making this possible is to
automatically close the <p> when required: before headers, subsequent
paragraphs, lists, indented blocks, synopsis blocks, tbl(7) blocks,
and before blocks using no-fill mode.
In man(7) documents, represent the .sp request by a blank line in
no-fill mode and in the same way as .PP in fill mode.
Ingo Schwarze [Sat, 5 Jan 2019 21:55:11 +0000 (21:55 +0000)]
In no-fill mode, avoid bogus blank lines in two situations:
1. After the last child; the parent will take care of the line break.
2. At the .YS macro; the end of the preceding .SY already broke the line.
Ingo Schwarze [Sat, 5 Jan 2019 20:04:50 +0000 (20:04 +0000)]
Slowly start doing more HTML output tests, in this case for the
interaction of .nf and .RS, related to man_macro.c rev. 1.106.
HTML regression testing is tricky because it is extremely prone to
over-testing, i.e. unintentional testing for volatile formatting
details which are irrelevant for deciding whether the HTML output
is good or bad. Minor changes to the formatter - which is still
heavily under development - might result in the necessity to
repeatedly adjust many test cases.
Then again, HTML syntax rules are so complicated that without
regression testing, the risk is simply too high that later changes
will re-introduce issues that were already fixed earlier. Let's
just try to design the tests very carefully in such a way that
the *.out_html files contain nothing that is likely to change, and
defer testing in cases where the HTML output is not yet clean enough
to allow designing tests in such a way.
Ingo Schwarze [Sat, 5 Jan 2019 18:59:46 +0000 (18:59 +0000)]
In HTML output, man(7) .RS blocks get formatted as <div class="Bd-indent">,
and i can see no reasonable alternative: they do indeed represent indented
displays. They certainly require flow context and make no sense in phrasing
context. Consequently, they have to suspend no-fill mode during their head,
in just the same way as other paragraph-type macros do it.
This fixes HTML syntax errors that resulted from .nf followed by .RS.
Ingo Schwarze [Sat, 5 Jan 2019 09:46:34 +0000 (09:46 +0000)]
minor cleanup, no functional change:
* delete one irrelevant FIXME; no more fixed lengths in HTML, please
* simplify some conditions
* avoid testing pointers as truth values, use "!= NULL"
* sort some declarations
* delete some pointless blank lines
Ingo Schwarze [Sat, 5 Jan 2019 09:14:44 +0000 (09:14 +0000)]
Now that the NODE_NOFILL flag in the syntax tree is accurate,
use it in the man(7) HTML formatter rather than keeping fill mode
state locally, resulting in massive simplification (minus 40 LOC).
Move the html_fillmode() state handler function to the html.c module
such that both the man(7) and the roff(7) formatter (and in the future,
also the mdoc(7) formatter) can use it. Give it a query mode, to be
invoked with TOKEN_NONE.
Ingo Schwarze [Sat, 5 Jan 2019 01:29:32 +0000 (01:29 +0000)]
minor cleanup, no functional change:
* in node type switches, explicitly handle all types, sort them,
and abort() on those that cannot occur
* avoid testing pointers as truth values, use "!= NULL"
* avoid testing "constant == variable", use "variable == constant"
* prefer sizeof(var) over sizeof(type)
* delete one duplicate function
* sort some declarations
* delete some useless blank lines
Ingo Schwarze [Sat, 5 Jan 2019 00:36:50 +0000 (00:36 +0000)]
Some high-level block macros have an effect similar to temporarily
suspending no-fill mode during their head. Model this with an
additional roff parser state flag ROFF_NONOFILL. That is much
simpler than it would be to save and restore the ROFF_NOFILL flag
itself, in particular since the latter can be switched (with lasting
effect) by the .nf and .fi requests even while its effect is
temporarily suspended.
This commit does not change formatting yet, but prepares for future
formatting simplifications and improvements.
Ingo Schwarze [Fri, 4 Jan 2019 04:04:14 +0000 (04:04 +0000)]
Test interaction of low-level roff(7) filling requests with .Bd in general
and filling in .Bd -centered in particular; related to mdoc_term.c rev. 1.372.
Ingo Schwarze [Fri, 4 Jan 2019 03:39:01 +0000 (03:39 +0000)]
Two functional improvements to filling in terminal output.
1. Fully support no-fill mode in mdoc(7), even when invoked with
low-level roff(7) .nf requests. As a side effect, this substantially
simplifies the implementation of .Bd -unfilled and .Bd -literal.
2. Let .Bd -centered fill its text, using the new TERMP_CENTER flag.
That finally fixes the long-standing bug that it used to operate in
no-fill mode, which was known to be wrong for at least five years.
This also simplifies the implementation of .Bd -centered considerably.
Ingo Schwarze [Fri, 4 Jan 2019 03:21:02 +0000 (03:21 +0000)]
Implement centering and adjustment to the right margin directly in
the terminal filling routine, controlled by new flags TERMP_CENTER
and TERMP_RIGHT.
This became possible by the recent term_flushln() rewrite.
No functional change yet, but to be used by upcoming commits.
Ingo Schwarze [Fri, 4 Jan 2019 03:17:36 +0000 (03:17 +0000)]
Oops, i forgot to adjust this file to the changes in roff.h rev. 1.67.
Provide a handler for the new .nf and .fi roff(7) request nodes,
avoiding a potential crash, and correctly restore the former fill
more at .Ed even when there was .nf or .fi inside the block.
Ingo Schwarze [Thu, 3 Jan 2019 19:59:55 +0000 (19:59 +0000)]
Rewrite the line filling function for terminal output yet again.
This function has always been among the most complicated parts of
mandoc, and it repeatedly needed substantial functional enhancements.
The present rewrite is required to prepare for the implementation
of simultaneous filling and centering of output lines.
The previous implementation looked at each word in turn and printed
it to the output stream as soon as it was found to still fit on the
current output line. Obviously, that approach neither allows
centering nor adjustment to the right margin.
The new implementation first decides which part of the paragraph
to put onto the current output line, also measuring the display
width of that part, even if that part consists of multiple words
including intervening whitespace. This will allow moving the whole
output line to the right as desired before printing it, for example
to center it or to adjust it to the right margin.
The function is split into three parts, each much shorter, solving a
better defined task, much easier to understand and better commented:
1. the steering function term_flushln() looping over output lines;
2. the calculation function term_fill() looping over input characters;
3. and the output function term_field() looping over printed characters.
Ingo Schwarze [Tue, 1 Jan 2019 08:18:11 +0000 (08:18 +0000)]
Support taking the -O tag value from apropos(1) key=value search terms;
feature improvement suggested by kn@.
While here, also make "-O value" work from standard input.
OK kn@
Ingo Schwarze [Tue, 1 Jan 2019 07:42:04 +0000 (07:42 +0000)]
Correctly set the ROFF_NOFILL parser flag for .Bd .Ed .Sh, such
that children and later siblings get correct NODE_NOFILL assignments.
This doesn't change rendering yet but prepares for future rendering
improvements.
Ingo Schwarze [Tue, 1 Jan 2019 03:45:29 +0000 (03:45 +0000)]
Now that .nf and .fi are implemented in the roff(7) parser and formatters
rather than in the man(7) parser and formatters, document them in the
roff(7) manual, where they belong, rather than in the man(7) manual.
Mention that they imply an output line break, and mention which macros
imply these requests.
Ingo Schwarze [Mon, 31 Dec 2018 11:01:37 +0000 (11:01 +0000)]
Cleanup, minus 25 LOC, no functional change:
Delete the complicated mechanism keeping fill mode state locally in
the man(7) HTML formatter. Instead, use the state stored in the nodes.
Ingo Schwarze [Mon, 31 Dec 2018 10:35:56 +0000 (10:35 +0000)]
Cleanup, no functional change:
Stop trying to keep fill mode state locally in the mdoc HTML formatter,
rely on the state stored in the nodes instead.
Note that the .Bd -literal code is buggy. Nested literal displays
result in nested <pre> elements, which violates HTML syntax.
But i'm not yet fixing bugs in this commit, i'm merely deleting
code which has no effect.
Ingo Schwarze [Mon, 31 Dec 2018 10:04:39 +0000 (10:04 +0000)]
Cleanup, no functional change:
Since the man(7) and roff(7) validators no longer use the parser
state flag ROFF_NOFILL, we can finally get rid of the function
man_state(), resulting in a better separation of parsing and validation.
Ingo Schwarze [Mon, 31 Dec 2018 08:38:21 +0000 (08:38 +0000)]
Use the new flag NODE_NOFILL in the validators, which is sometimes
simpler and always more robust. In particular, move the nesting
warnings for .EX and .EE from man_state(), where they were misplaced,
to the man(7) validator.
Ingo Schwarze [Mon, 31 Dec 2018 08:18:12 +0000 (08:18 +0000)]
Store the fill mode with a new flag NODE_NOFILL in every node,
like it is already done with NODE_SYNPRETTY, such that the fill
mode becomes more directly available to the formatters.
Not used yet, but will be used by upcoming commits.
Ingo Schwarze [Mon, 31 Dec 2018 08:03:46 +0000 (08:03 +0000)]
For .EX and .EE, set the fill mode parser state directly in the
macro parsing function, in the same way as the roff parser already
does it for the .nf and .fi requests. This is a preparation for
getting rid of the ugly function man_state() later on.