summaryrefslogtreecommitdiffstats
path: root/regress/usr.bin/mandoc/man (follow)
Commit message (Collapse)AuthorAgeFilesLines
* In HTML output, avoid printing a newline right after <pre>schwarze2020-10-165-75/+37
| | | | | | | | 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@.
* Element next-line scopes can nest. Consequently, even when closingschwarze2020-09-095-10/+34
| | | | | | | | 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>.
* trivial adjustment of the desired test resultsschwarze2020-07-215-22/+22
| | | | after getting rid of the "copyless" crutch
* In fragment identifiers, use ~%d for ordinal suffixes,schwarze2020-04-203-5/+5
| | | | | | | | | 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 '~'.
* automatically tag .SH and .SS in man(7) terminal outputschwarze2020-04-047-2/+18
| | | | in the same way as it was done for .Sh and .Ss in mdoc(7)
* Split tagging into a validation part including prioritizationschwarze2020-03-1318-19/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Introduce the concept of nodes that are semantically transparent:schwarze2020-02-2723-14/+291
| | | | | | | | | | | | | | 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@.
* Align to the new, sane behaviour of the groff_mdoc(7) .Dd macro:schwarze2020-01-197-7/+7
| | | | | | | | 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.
* Give up on the illusion that the maintainer targets for regenerating theschwarze2020-01-081-8/+2
| | | | | | | | | | | | | 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.
* adapt to new <p> output logic (html.c rev. 1.131)schwarze2019-09-038-28/+12
|
* Wrap .Sh/.SH sections and .Ss/.SS subsections in HTML <section> elementsschwarze2019-03-013-0/+10
| | | | | | 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>.
* Remove the HTML title= attributes which harmed accessibility andschwarze2019-01-114-8/+8
| | | | | | | 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.
* Finally, represent the man(7) .PP and .HP macros by the naturalschwarze2019-01-0624-42/+327
| | | | | | | | | | | 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.
* In no-fill mode, avoid bogus blank lines in two situations:schwarze2019-01-052-1/+33
| | | | | 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.
* In groff, when the .SY block macro occurs in no-fill mode,schwarze2019-01-054-2/+66
| | | | the output line gets broken after the head. Do the same.
* Slowly start doing more HTML output tests, in this case for theschwarze2019-01-054-12/+44
| | | | | | | | | | | | | | | | | | | 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.
* catch up with the changed order of warnings;schwarze2018-12-312-2/+2
| | | | related to man_validate.c rev. 1.115
* Rename mandoc_getarg() to roff_getarg() and pass it the roff parserschwarze2018-12-213-13/+14
| | | | | | | | | | | | | | | | | | 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.
* Clean up the validation of .Pp, .PP, .sp, and .br. Make sure allschwarze2018-12-044-2/+12
| | | | | | | | | | | | | | 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.
* In the validators, translate obsolete macro aliases (Lp, Ot, LP, P)schwarze2018-12-031-2/+2
| | | | | | 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.
* support tail arguments on the .ME and .UE macros,schwarze2018-08-146-18/+35
| | | | used for example in the ditroff(7) manual of the groff package
* Now that we have the -Wstyle message level, downgrade six warningsschwarze2017-07-064-5/+5
| | | | | | 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.
* Messages of the -Wbase level now print STYLE:. Since thisschwarze2017-07-04129-227/+279
| | | | | | | | 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.
* test new MT macroschwarze2017-06-258-2/+101
|
* cope with changes in BASE messagesschwarze2017-06-2532-32/+32
|
* churn related to the new style message about RCS idsschwarze2017-06-1734-2/+34
|
* if .in is used inside the .TP head, it's always relativeschwarze2017-06-173-2/+36
|
* improve rounding rules for scaling unitsschwarze2017-06-144-10/+10
| | | | in horizontal orientation in the terminal formatter
* Partial support for the \n[an-margin] number register.schwarze2017-06-133-2/+43
| | | | | | | | | | | | | | | 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.
* ignore blank lines in man(7) next line scope;schwarze2017-06-0316-6/+59
| | | | strange groff edge case behaviour found in multimedia/mjpegtools
* Move .sp to the roff modules. Enough infrastructure is in placeschwarze2017-05-051-0/+4
| | | | now that this actually saves code: -70 LOC.
* Now that markdown output is tested for almost everything, test allschwarze2017-03-081-1/+2
| | | | | | 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.
* more tests for .IP/.nf interaction that i forgot to commitschwarze2017-02-172-2/+69
|
* Cope with the changed order of warning and error messages caused by theschwarze2015-12-012-4/+4
| | | | | | | 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@.
* Trailing whitespace is significant when determining the width of a tagschwarze2015-09-215-4/+113
| | | | | 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@.
* Fill mode changes don't break next-line scope in all cases,schwarze2015-09-047-6/+43
| | | | | | in particular not for tagged paragraphs. Issue found by Christian Neukirchen <chneukirchen at gmail dot com> in the exiv2(1) manual page.
* If an explicit line break request (.br or .sp) occurs within an .HP block,schwarze2015-04-192-0/+34
| | | | | | | 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).
* Do not mistreat empty arguments to font alternating macrosschwarze2015-04-063-2/+30
| | | | as vertical spacing requests. Bug found with xmahjongg(6).
* On a new RS nesting level, the saved width starts from the defaultschwarze2015-04-062-2/+18
| | | | | width, not from the saved width of the previous level. Improves xterm(1) and XSetEventQueueOwner(3); found in transcode_filter(1).
* Use the default width for .RS without arguments.schwarze2015-04-063-2/+43
| | | | | Reduces groff-mandoc differences in base and Xenocara by about 4%. Found while looking at wpa_supplicant(8).
* Give man(7) section and subsection headers heanging indentation.schwarze2015-04-046-4/+56
| | | | | | Reduces groff-mandoc differences in base by about 2.5% due to various Perl manuals having long section titles. Quirk found in argtable2(3).
* Fix a quirk with respect to empty .HP.schwarze2015-04-042-4/+15
| | | | | Found while writing a regression test for man_macro.c rev. 1.66. Incidentally, this brings rendering of XFreeEventData(3) closer to groff.
* more tests regarding empty header linesschwarze2015-03-2015-28/+221
|
* The .PD macro can occur in next-line scope. Fixes zshmisc(1).schwarze2015-03-203-2/+77
| | | | Issue reported by Christian Neukirchen <chneukirchen at gmail dot com>.
* better error reporting regarding .OP .RS .UR .TH argumentsschwarze2015-02-0611-11/+54
|
* better diagnostics about excess arguments to .PD .ft .spschwarze2015-02-062-2/+4
|
* better error reporting for .br .fi .nf with argumentsschwarze2015-02-062-2/+4
|
* Delete the legacy generic warning type MANDOCERR_ARGCWARN,schwarze2015-02-062-2/+3
| | | | | replacing the last instances by more specific warnings. Improved functionality, minus 50 lines of code.
* Make the mandoc test suite completely silent.schwarze2015-02-031-2/+2
| | | | | | | | | | Not even i looked at the 966 mandoc command lines and the 787 diff command lines it was spewing, and it was almost unusable without REGRESS_FAIL_EARLY because any errors got lost among all the noise. If you want to debug the Makefiles, use "make -dl". If you want to see the -Tman TODOs, use "grep -RF SKIP_TMAN".
* starting a tbl(7) breaks man(7) next-line scope;schwarze2015-01-304-2/+75
| | | | triggered by a bug report from jsg@