summaryrefslogtreecommitdiff
path: root/regress/usr.bin/mandoc
AgeCommit message (Collapse)Author
2019-04-21When calling an empty macro, do not clobber existing arguments.Ingo Schwarze
Fixing a bug found with the groffer(1) version 1.19 manual page following a report from Jan Stary.
2019-04-21Implement the roff .break request (break out of a .while loop).Ingo Schwarze
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.
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-02-06Let roff_getname() end the roff identifier at a tab characterIngo Schwarze
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.
2019-01-31Since resetting of offsets works quite differently in man(7) and mdoc(7),Ingo Schwarze
test table centering in an mdoc(7) document as well. Related to tbl_term.c rev. 1.55.
2015-01-29reorg tbl(7) test suiteIngo Schwarze
2019-01-17Test handling of escaped backslashes because the code related toIngo Schwarze
copy mode is complicated and prone to regressions.
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-07Represent mdoc(7) .Pp (and .sp, and some SYNOPSIS and .Rs features)Ingo Schwarze
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.
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.
2019-01-04fix the dates that got broken by cvs commitIngo Schwarze
2019-01-04Test interaction of low-level roff(7) filling requests with .Bd in generalIngo Schwarze
and filling in .Bd -centered in particular; related to mdoc_term.c rev. 1.271.
2019-01-04test the roff(7) .ce and .rj requests;Ingo Schwarze
they were already supported in the past
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-20Bugfix:Ingo Schwarze
When after a \\, \t, or \a, another \t or \a had to be resolved in copy mode within the same argument, the argument got corrupted. Found while working on a loosely related bug report from Fabio Scotoni <fabio at esse dot ch>.
2018-12-16make test output less uglyIngo Schwarze
2018-12-15Yet another round of improvements to manual font selection.Ingo Schwarze
Unify handling of \f and .ft. Support \f4 (bold+italic). Support ".ft BI" and ".ft CW" for terminal output. Support the .ft request in HTML output. Reject the bogus fonts \f(C1, \f(C2, \f(C3, and \f(CP.
2018-12-15Several improvements to escape sequence handling.Ingo Schwarze
* Add the missing special character \_ (underscore). * Partial implementations of \a (leader character) and \E (uninterpreted escape character). * Parse and ignore \r (reverse line feed). * Add a WARNING message about undefined escape sequences. * Add an UNSUPP message about unsupported escape sequences. * Mark \! and \? (transparent throughput) and \O (suppress output) as unsupported. * Treat the various variants of zero-width spaces as one-byte escape sequences rather than as special characters, to avoid defining bogus forms with square brackets. * For special characters with one-byte names, do not define bogus forms with square brackets, except for \[-], which is valid. * In the form with square brackets, undefined special characters do not fall back to printing the name verbatim, not even for one-byte names. * Starting a special character name with a blank is an error. * Undefined escape sequences never abort formatting of the input string, not even in HTML output mode. * Document the newly handled escapes, and a few that were missing. * Regression tests for most of the above.
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-12-03adapt to the change in mansearch.c rev. 1.62;Ingo Schwarze
reminded by bluhm@, thanks!
2018-11-26When a conditional block is closed by putting "\}" on a text lineIngo Schwarze
by itself (which is somewhat unusual but not invalid; most authors use the empty macro line ".\}" instead), agree more closely with groff and do not produce a double space in the output. Quirk reported by millert@. While here, tweak the rest of the function body of roff_cond_text() to more closely match roff_cond_sub(). The subtly different handling could make people (including myself) wonder whether there is any point in being different. Testing shows there is not.
2018-10-02Render the eqn(7) "sqrt" function as U+221A in UTF-8 output.Ingo Schwarze
This also agrees with what groff does. Suggested by an attendee of EuroBSDCon 2018 in Bucuresti. Written on the plane Bucuresti-Frankfurt returning from EuroBSDCon.
2018-08-25oops, hook up the tests for the roff(7) .char requestIngo Schwarze
2018-08-25Rudimentary implementation of the roff(7) .char (output glyphIngo Schwarze
definition) request, used for example by groff_hdtbl(7). This simplistic implementation may interact incorrectly with the .tr (input character translation) request. But come on, you are not only using .char *and* .tr, but you do so with respect to the same character in the same manual page?
2018-08-25If man(7) next-line scope is open and the line ends with \c,Ingo Schwarze
the scope remains open. Needed for example for groff_man(7).
2018-08-24Fix dates that got broken by committing from one day to anotherIngo Schwarze
due to timezone differences.
2018-08-24Rudimentary implementation of the roff(7) .while request.Ingo Schwarze
Needed for example by groff_hdtbl(7). There are two limitations: It does not support nested .while requests yet, and each .while loop must start and end in the same scope. The roff_parseln() return codes are now more flexible and allow OR'ing options.
2018-08-23Implement the roff(7) .shift and .return requests,Ingo Schwarze
for example used by groff_hdtbl(7) and groff_mom(7). Also correctly interpolate arguments during nested macro execution even after .shift and .return, implemented using a stack of argument arrays. Note that only read.c, but not roff.c can detect the end of a macro execution, and the existence of .shift implies that arguments cannot be interpolated up front, so unfortunately, this includes a partial revert of roff.c rev. 1.209, moving argument interpolation back into the function roff_res().
2018-08-21Improve the ASCII rendering of \(Po (Pound Sterling)Ingo Schwarze
and of the playing card suits to match groff, using feedback from Ralph Corderoy <ralph at inputplus dot co dot uk>.
2018-08-21Fix some issues found looking at groff_char(7):Ingo Schwarze
* Add two missing characters, \('Y and \('y. * The Weierstrass p is not capital, see http://unicode.org/notes/tn27/. * Add a groff-compatible ASCII transliteration for U+02DC: "~".
2018-08-19Disable one test for now that is broken after the addition of \).Ingo Schwarze
It is not broken because of \), which is correctly implemented, but the addition merely reveals a hidden bug elsewhere, almost certainly in \\ handling. Given that \\ is among the most mysterious escape sequences and using it is very strongly discouraged in manual pages, fixing that is not urgent - and it may be hard.
2018-08-16Implement the \*(.T predefined string (interpolate device name)Ingo Schwarze
by allowing the preprocessor to pass it through to the formatters. Used for example by the groff_char(7) manual page.
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
2018-04-10Two new low-level roff(7) features:Ingo Schwarze
* .nr optional third argument (auto-increment step size) * \n+ and \n- numerical register auto-increment and -decrement bentley@ reported on Dec 9, 2013 that lang/sbcl(1) uses these.
2018-04-09When accessing an undefined number register, define it to be zero, likeIngo Schwarze
the previous commit for strings and macros, only technically simpler. Desired behaviour also mentioned by Werner Lemberg in 2011. This diff adds functionality but is -21 +19 LOC. :-)
2018-04-09Using an undefined string or macro will cause it to be defined as empty.Ingo Schwarze
Observed by Werner Lemberg on Nov 14, 2011 and rotting on my TODO list ever since.
2018-02-23Logically, the following are are type names - just like .Vt,Ingo Schwarze
some of them with an optional variable name following: - .Ft - .Fa in the SYNOPSIS - .Fn second and later arguments in the SYNOPSIS So add these to the .Vt macro table in the mandoc.db(5) database. During my LibreSSL work, i'm getting really tired of typing $ man -k Vt,Ft,Fa=some_type_name over and over again; now, this becomes just: $ man -k Vt=some_type_name
2018-02-07fix wrong dateIngo Schwarze
2018-02-06Delete the "no blank before trailing delimiter" check from theIngo Schwarze
partial explicit macros. Leah Neukirchen <leah at vuxu dot org> rightfully points out that the check makes no sense for these macros.
2018-01-13catch up with how formatting of long links was changedIngo Schwarze
in both groff and mandoc
2017-08-23eliminate white space after opening and before closing punctuationIngo Schwarze
2017-08-23Suppress spacing before certain kinds of lists.Ingo Schwarze
One benefit is a reduced probablity that a blank appears between a function name and the opening parenthesis introducing the arguments. The heuristics isn't perfect and may occasionally suppress a blank that wouldn't do harm.
2017-08-23Improve ASCII rendering of a few rare character escape sequencesIngo Schwarze
that can be changed unilaterally because groff fails to render them at all.
2017-08-23Catch up with mansearch.c rev. 1.60: When finding a bogus databaseIngo Schwarze
entry, print a meaningful warning and skip the entry. The tests now require the actual manual pages to be around in addition to the database, they find more results and print more warnings.
2017-08-23catch up with ASCII renderings in chars.c rev. 1.42Ingo Schwarze