summaryrefslogtreecommitdiff
path: root/regress/usr.bin/mandoc/man
AgeCommit message (Collapse)Author
2023-11-24Additional tests of automatic tagging involving different kinds of hyphensIngo Schwarze
after tag.c rev. 1.38.
2023-11-13reduce the man(7) global indentation from 7n to 5n, see man_term.c rev. 1.197Ingo Schwarze
2023-10-24Implement the man(7) .MR macro, a 2023 GNU extension.Ingo Schwarze
The syntax and semantics is almost identical to mdoc(7) .Xr. This will be needed for reading the groff manual pages once our port will be updated to 1.23, and the Linux Manual Pages Project is also determined to start using it sooner or later. I did not advocate for this new macro, but since we want to remain able to read all manual pages found in the wild, there is little choice but to support it. At least it is easy to do, they basically copied .Xr.
2023-04-28adjust after man_validate.c rev. 1.128 improved the error messagesIngo Schwarze
2022-08-28Vertical spacing changes around tables in man_term.c rev. 1.194Ingo Schwarze
and tbl_term.c rev. 1.66 cause quite a bit of churn, unfortunately. This commit cleans up most of it.
2022-08-15Some more tests of no-fill mode similar to mdoc/Bd/blank.inIngo Schwarze
after vertical spacing was improved in man_term.c rev. 1.192.
2022-08-02If the body of a man(7) .MT or .UR block is empty, do not emit a warning.Ingo Schwarze
Leaving the body empty is legitimate in this case if the author only wants to display a mail address or URI without providing a link text. Output modules already handle this correctly: terminal output shows just the URI without an accompanying text, HTML output uses the URI for *both* the href= attribute and as the content of the <a> element. The documentation was also wrong and claimed that an .MT or .UR block with an empty body would produce no output. As explained above, this isn't true. Bogus warning reported by Alejandro Colomar <alx dot manpages at gmail dot com>.
2022-07-06While the HTML standard allows multiple <h1> elements in the sameIngo Schwarze
document, <h1> is intended for top level headers, and most of the sections in a manual page can hardly be considered top-level. It is more usual to use <h1> only for the main title of the document of for the site name. Consequently, move .Sh/.SH from <h1> to <h2> and .Ss/.SS from <h2> to <h3>, freeing <h1> for use by header.html in man.cgi(8). Discussed with Anna Vyalkova <cyber at sysrq dot in>.
2022-04-28oops, fix wrong .TH nameIngo Schwarze
2022-04-28Element next-line scopes may nest, so man_breakscope() may have toIngo Schwarze
break multiple element next-line scopes at the same time, similar to what man_descope() already does for unconditional rewinding. This fixes an assertion failure that tb@ found with afl(1), caused by .SH .I .I .BI and similar sequences of macros without arguments.
2022-04-27The .AT, .DT, and .UC macros are allowed inside next-line scopeIngo Schwarze
and never produce output at the place of their invocation. Minibugs found while investigating unrelated afl(1) reports from tb@.
2022-04-13Do not die on an assertion if an input file contains no sectionIngo Schwarze
whatsoever and ends with a broken next-line scope. Obviously, this cannot happen in a real manual page, but mandoc(1) should not die even when fed absurd input. This bug was independently reported by both jsg@ and tb@ who both found it with afl(1).
2021-06-28delete the two pairs of extra blank lines from expected man(7) terminalIngo Schwarze
output that are no longer printed since man_term.c rev. 1.189
2020-10-16In HTML output, avoid printing a newline right after <pre>Ingo Schwarze
and right before </pre> because that resulted in vertical whitespace not requested by the manual page author. Formatting bug reported by Aman Verma <amanraoverma plus vim at gmail dot com> on discuss@.
2020-09-09Element next-line scopes can nest. Consequently, even when closingIngo Schwarze
one element next-line scope, the MAN_ELINE flag must not yet be cleared if the parent macro is another element macro having next-line scope, or an assertion failure is caused if all this is wrapped in another macro that has block next-line scope, for example .TP. Bug found in an afl run performed by Jan Schreiber <jes at posteo dot de>.
2020-07-21trivial adjustment of the desired test resultsIngo Schwarze
after getting rid of the "copyless" crutch
2020-04-20In fragment identifiers, use ~%d for ordinal suffixes,Ingo Schwarze
and reserve the character '~' for that purpose. Bug found by validator.w3.org in openssl(1), which contains both a tag "tls1_2" and a second instance of a tag "tls1", which also resulted in "tls1_2", causing a clash. Now, the second instance of "tls1" is rendered as "tls1~2" instead, employing the newly reserved '~'.
2020-04-04automatically tag .SH and .SS in man(7) terminal outputIngo Schwarze
in the same way as it was done for .Sh and .Ss in mdoc(7)
2020-03-13Split tagging into a validation part including prioritizationIngo Schwarze
in tag.{h,c} and {mdoc,man}_validate.c and into a formatting part including command line argument checking in term_tag.{h,c}, html.c, and {mdoc|man}_{term|html}.c. Immediate functional benefits include: * Improved prioritization of automatic tags for .Em and .Sy. * Avoiding bogus automatic tags when .Em, .Fn, or .Sy are explicitly tagged. * Explicit tagging of .Er and .Fl now works in HTML output. * Automatic tagging of .IP and .TP now works in HTML output. But mainly, this patch provides clean earth to build further improvements on. Technical changes: * Main program: Write a tag file for ASCII and UTF-8 output only. * All formatters: There is no more need to delay writing the tags. * mdoc(7)+man(7) formatters: No more need for elaborate syntax tree inspection. * HTML formatter: If available, use the "string" attribute as the tag. * HTML formatter: New function to write permalinks, to reduce code duplication. Style cleanup in the vicinity while here: * mdoc(7) terminal formatter: To set up bold font for children, defer to termp_bold_pre() rather than calling term_fontpush() manually. * mdoc(7) terminal formatter: Garbage collect some duplicate functions. * mdoc(7) HTML formatter: Unify <code> handling, delete redundant functions. * Where possible, use switch statements rather than if cascades. * Get rid of some more Yoda notation. The necessity for such changes was first discussed with kn@, but i didn't bother him with a request to review the resulting -673/+782 line patch.
2020-02-27Introduce the concept of nodes that are semantically transparent:Ingo Schwarze
they are skipped when looking for previous or following high-level macros. Examples include roff(7) .ft, .ll, and .ta, mdoc(7) .Sm and .Tg, and man(7) .DT and .PD. Use this concept for a variety of improved decisions in various validators and formatters. While here, * remove a few const qualifiers on struct arguments that caused trouble; * get rid of some more Yoda notation in the vicinity; * and apply some other stylistic improvements in the vicinity. I found this class of issues while considering .Tg patches from kn@.
2020-01-19Align to the new, sane behaviour of the groff_mdoc(7) .Dd macro:Ingo Schwarze
without an argument, use the empty string, and always concatenate all arguments, no matter their number. This allows reducing the number of arguments of mandoc_normdate() and some other simplifications, at the same time polishing some error messages by adding the name of the macro in question.
2020-01-08Give up on the illusion that the maintainer targets for regenerating theIngo Schwarze
desired output files could be run with an arbitrary roff(7) implementation; in reality, it only makes sense to run them with groff(1). Also, there is really no point in allowing the groff command line arguments to be overridden; running these targets only makes sense with exactly the right options. So get rid of the fragile ?= and += construct for groff options and make sure the options are always passed in a reasonable order. Finally, use groff(1) directly rather than the shallow nroff(1) wrapper because GNU nroff(1) does not support running the GNU eqn(1) preprocessor, which will probably be needed soon, and also because it simplifies using the GNU tbl(1) preprocessor.
2019-09-03adapt to new <p> output logic (html.c rev. 1.131)Ingo Schwarze
2019-03-01Wrap .Sh/.SH sections and .Ss/.SS subsections in HTML <section> elementsIngo Schwarze
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>.
2019-01-11Remove the HTML title= attributes which harmed accessibility andIngo Schwarze
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.
2019-01-06Finally, represent the man(7) .PP and .HP macros by the naturalIngo Schwarze
choice, which is <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.
2019-01-05In no-fill mode, avoid bogus blank lines in two situations:Ingo Schwarze
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.
2019-01-05In groff, when the .SY block macro occurs in no-fill mode,Ingo Schwarze
the output line gets broken after the head. Do the same.
2019-01-05Slowly start doing more HTML output tests, in this case for theIngo Schwarze
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.
2018-12-31catch up with the changed order of warnings;Ingo Schwarze
related to man_validate.c rev. 1.115
2018-12-21Rename mandoc_getarg() to roff_getarg() and pass it the roff parserIngo Schwarze
struct as an argument such that after copy-in, it can call roff_expand() once again, which used to be called roff_res() before this. This fixes a subtle low-level roff(7) parsing bug reported by Fabio Scotoni <fabio at esse dot ch> in the 4.4BSD-Lite2 mdoc.samples(7) manual page, because that page used an escaped escape sequence in a macro argument. To expand escaped escape sequences in quoted mdoc(7) arguments, too, stop bypassing the call to roff_getarg() in mdoc_argv.c, function args() for this case. This does not solve the case of escaped escape sequences in quoted .Bl -column phrases yet. Because roff_expand() can make the string longer, roff_getarg() can no longer operate in-place but needs to malloc(3) the returned string. In the high-level parsers, free(3) that string after processing it.
2018-12-04Clean up the validation of .Pp, .PP, .sp, and .br. Make sure allIngo Schwarze
combinations are handled, and are handled in a systematic manner. This resolves some erratic duplicate handling, handles a number of missing cases, and improves diagnostics in various respects. Move validation of .br and .sp to the roff validation module rather than doing that twice in the mdoc and man validation modules. Move the node relinking function to the roff library where it belongs. In validation functions, only look at the node itself, at previous nodes, and at descendants, not at following nodes or ancestors, such that only nodes are inspected which are already validated.
2018-12-03In the validators, translate obsolete macro aliases (Lp, Ot, LP, P)Ingo Schwarze
to the standard forms (Pp, Ft, PP) up front, such that later code does not need to look for the obsolete versions. This reduces the risk of incomplete handling.
2018-08-14support tail arguments on the .ME and .UE macros,Ingo Schwarze
used for example in the ditroff(7) manual of the groff package
2017-07-06Now that we have the -Wstyle message level, downgrade six warningsIngo Schwarze
that are not syntax mistakes and that do not cause wrong formatting or content to style suggestions. Also upgrade two warnings that may cause information loss to errors.
2017-07-04Messages of the -Wbase level now print STYLE:. Since thisIngo Schwarze
causes horrible churn anyway, profit of the opportunity to stop excessive testing, such that this is hopefully the last instance of such churn. Consistently use OpenBSD RCS tags, blank .Os, blank fourth .TH argument, and Mdocdate like everywhere else. Use -Ios=OpenBSD for platform-independent predictable output.
2017-06-25test new MT macroIngo Schwarze
2017-06-25cope with changes in BASE messagesIngo Schwarze
2017-06-17churn related to the new style message about RCS idsIngo Schwarze
2017-06-17if .in is used inside the .TP head, it's always relativeIngo Schwarze
2017-06-14improve rounding rules for scaling unitsIngo Schwarze
in horizontal orientation in the terminal formatter
2017-06-13Partial support for the \n[an-margin] number register.Ingo Schwarze
Manuals autogenerated from reStructuredText are reckless enough to peek at this non-portable, implementation-dependent, highly groff-specific internal register - for no good reason, because the man(7) language natively provides in a much simpler way what they are trying to emulate here with much fragility. A full implementation would be very hard because it would require access to output-device-specific formatting data at the roff(7) preprocessor stage, which mandoc doesn't support at all. So hardcode a few magic numbers as reStructuredText expects them for terminal output. For other output modes (like HTML), code using this register is utterly broken anyway.
2017-06-03ignore blank lines in man(7) next line scope;Ingo Schwarze
strange groff edge case behaviour found in multimedia/mjpegtools
2017-05-05Move .sp to the roff modules. Enough infrastructure is in placeIngo Schwarze
now that this actually saves code: -70 LOC.
2017-03-08Now that markdown output is tested for almost everything, test allIngo Schwarze
input files in -T markdown output mode by default and only mark those files with SKIP_MARKDOWN that are not to be tested. Much easier to read, and almost minus 40 lines of Makefile code.
2017-02-17more tests for .IP/.nf interaction that i forgot to commitIngo Schwarze
2015-12-01Cope with the changed order of warning and error messages caused by theIngo Schwarze
seperation of parsing and validation modules. I originally intended to mop this up when the parser reorg is complete, but since the work stalled a bit, i should not leave this lying around broken for weeks. Reminded by daniel@.
2015-09-21Trailing whitespace is significant when determining the width of a tagIngo Schwarze
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@.
2015-09-04Fill mode changes don't break next-line scope in all cases,Ingo Schwarze
in particular not for tagged paragraphs. Issue found by Christian Neukirchen <chneukirchen at gmail dot com> in the exiv2(1) manual page.
2015-04-19If an explicit line break request (.br or .sp) occurs within an .HP block,Ingo Schwarze
the next line doesn't hang, but is simply indented. Issue found by Christian Neukirchen <chneukirchen at gmail dot com> in the dmsetup(8) manual on Linux. This patch also improves the indentation of XDGA(3) and XrmGetResource(3).