summaryrefslogtreecommitdiffstats
path: root/regress/usr.bin/mandoc/mdoc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* In HTML output, correctly render .Bd -unfilled in proportionally-spacedschwarze2021-03-301-1/+1
| | | | | | | | | | | font, rather than with the monospace font appropriate for .Bd -literal. This fixes a minibug reported by anton@. Implemented by no longer relying on the typical browser default of "pre { font-family: monospace }" but instead letting <pre> elements inherit the font family from their parent, then adding an explicit CSS .Li class only for those displays where the manual page author requested it by using the -literal option on the .Bd macro.
* In HTML output, avoid printing a newline right after <pre>schwarze2020-10-163-17/+8
| | | | | | | | 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@.
* trivial adjustment of the desired test resultsschwarze2020-07-2123-133/+133
| | | | after getting rid of the "copyless" crutch
* While we do not recommend the idiom ".Fl Fl long" for long optionsschwarze2020-04-266-4/+65
| | | | | | | | | | | because it is an abuse of semantic macros for device-specific presentational effects, this idiom is so widespread that it makes sense to convert it to the recommended ".Fl \-long" during the validation phase. For example, this improves HTML formatting in pages where authors have used the dubious .Fl Fl. Feature suggested by Steffen Nurpmeso <steffen at sdaoden dot eu> on freebsd-hackers.
* In fragment identifiers, use ~%d for ordinal suffixes,schwarze2020-04-202-3/+3
| | | | | | | | | 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 '~'.
* When .Bd, .D1, or .Dl is tagged, attach the permalinkschwarze2020-04-1922-49/+113
| | | | to the first few letters, similar to what was earlier done for .Pp.
* When a .Tg is attached to a paragraph, attach the permalinkschwarze2020-04-189-15/+38
| | | | to the first word, or the first few words if they are short.
* Separate the place to put the <a href> permalink (now markedschwarze2020-04-0716-37/+37
| | | | | | | with NODE_HREF) from the target element of the link (still marked with NODE_ID). In many cases, use this to move the target to the beginning of the paragraph, such that readers don't get dropped into the middle of a sentence.
* Support manual tagging of .Pp, .Bd, .D1, .Dl, .Bl, and .It.schwarze2020-04-0641-41/+220
| | | | | | In HTML output, improve the logic for writing inside permalinks: skip them when there is no child content or when there is a risk that the children might contain flow content.
* Copy tagged strings before marking hyphens as breakable.schwarze2020-04-0216-25/+40
| | | | For example, this makes ":tCo-processes" work in ksh(1).
* Just like we are already doing it in HTML output, automatically tagschwarze2020-04-0120-6/+85
| | | | | | | section and subsection headers in terminal output, too. Even though admittedly, commands like "/SEE" and "/ Subsec" work, too, there is no downside, and besides, with the recent improvements in the tagging framework, implementation cost is negligible.
* test skipping of initial hyphens and minus signs in automatic tags;schwarze2020-03-215-6/+42
| | | | related to tags.c rev. 1.30
* typos resulted in two tests not being runschwarze2020-03-132-7/+7
|
* Split tagging into a validation part including prioritizationschwarze2020-03-1381-26/+1078
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fully support explicit tagging of .Sh and .Ss.schwarze2020-02-275-3/+82
| | | | | | | | | | | | | | | | | | | | | | | | | This fixes the offset of two lines in terminal output and this improves HTML output by putting the id= attribute and <a> element into the respective <h1> or <h2> element rather than writing an additional <mark> element. To that end, introduce node flags NODE_ID (to make the node a link target, for example by writing an HTML id= attribute or by calling tag_put()) and NODE_HREF (to make the node a link source, used only in HTML output, used only to write an <a class="permalink"> element). In particular: * In the validator, generalize the concept of the "next node" such that it also works before .Sh and .Ss. * If the first argument of .Tg is empty, don't forget to complain if there are additional arguments, which will be ignored. * In the terminal formatter, support writing of explicit tags for all kinds of nodes, not just for .Tg. * In deroff(), allow nodes to have an explicit string representation even when they aren't text nodes. Use this for explicitly tagged section headers. Suprisingly, this is sufficient to make HTML output work, without explicit code changes in the HTML formatter. * In syntax tree output, display NODE_ID and NODE_HREF.
* Introduce the concept of nodes that are semantically transparent:schwarze2020-02-2731-23/+544
| | | | | | | | | | | | | | 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@.
* update Mdocdate for a test that got broken by committing to the out_lint fileschwarze2020-01-193-4/+4
|
* Align to the new, sane behaviour of the groff_mdoc(7) .Dd macro:schwarze2020-01-1910-20/+32
| | | | | | | | 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-2/+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.
* oops, commit correct version of the expected resultsschwarze2019-09-131-5/+4
|
* Improve validation of function names:schwarze2019-09-134-4/+65
| | | | | | 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 new <p> output logic (html.c rev. 1.131)schwarze2019-09-036-18/+6
|
* fix date which got broken by Mdocdate during commitschwarze2019-07-112-2/+2
|
* When parsing a tab character that is not preceded by a space characterschwarze2019-07-112-4/+5
| | | | | | | | | | | | | | | | 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@).
* Wrap .Sh/.SH sections and .Ss/.SS subsections in HTML <section> elementsschwarze2019-03-012-0/+6
| | | | | | 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-112-11/+10
| | | | | | | 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.
* Represent mdoc(7) .Pp (and .sp, and some SYNOPSIS and .Rs features)schwarze2019-01-0729-25/+431
| | | | | | | | | | | | | | | | | | | 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.
* fix the dates that got broken by cvs commitschwarze2019-01-044-4/+4
|
* Test interaction of low-level roff(7) filling requests with .Bd in generalschwarze2019-01-047-13/+98
| | | | and filling in .Bd -centered in particular; related to mdoc_term.c rev. 1.271.
* Rename mandoc_getarg() to roff_getarg() and pass it the roff parserschwarze2018-12-2125-12/+341
| | | | | | | | | | | | | | | | | | 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-042-2/+4
| | | | | | | | | | | | | | 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.
* fix wrong dateschwarze2018-02-072-2/+2
|
* Delete the "no blank before trailing delimiter" check from theschwarze2018-02-069-18/+3
| | | | | partial explicit macros. Leah Neukirchen <leah at vuxu dot org> rightfully points out that the check makes no sense for these macros.
* catch up with how formatting of long links was changedschwarze2018-01-131-3/+2
| | | | in both groff and mandoc
* fix dateschwarze2017-07-282-2/+2
|
* Do not test .Xr here. It is not what this directory should focus on,schwarze2017-07-286-28/+20
| | | | and it is causing too much trouble in -portable.
* Avoid cross reference to mandoc(1) because it may cause a messageschwarze2017-07-206-14/+14
| | | | | on other operating systems where mandoc is not installed, causing the test to fail in the portable test suite.
* fix datesschwarze2017-07-164-4/+4
|
* test -diag -width and -inset -widthschwarze2017-07-167-11/+19
|
* Now that we have the -Wstyle message level, downgrade six warningsschwarze2017-07-067-16/+16
| | | | | | 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-04834-1803/+1639
| | | | | | | | 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.
* warn about some non-portable idioms in .Bl -column;schwarze2017-06-297-9/+75
| | | | triggered by a question from Yuri Pankov (illumos)
* warn about .Ns macros that have no effect because they are followedschwarze2017-06-274-4/+21
| | | | by an isolated closing delimiter; inspired by mdoclint
* cope with changes in BASE messagesschwarze2017-06-25139-274/+415
|
* churn related to the new style message about RCS idsschwarze2017-06-17139-0/+139
|
* improve rounding rules for scaling unitsschwarze2017-06-145-12/+12
| | | | in horizontal orientation in the terminal formatter
* churn caused by the new Mdocdate messages, no easy way to avoid this :(schwarze2017-06-11135-0/+136
|
* Do not issue the message "no blank before trailing delimiter" for .No.schwarze2017-06-111-1/+0
| | | | | | | In practice, that message only matters inside .Bf, and even there, it can occasionally be a false positive. In all other cases, it usually is a false positive, so it is better to drop it outright. Suggested by jmc@.
* style message about missing blank before trailing delimiter;schwarze2017-06-10152-215/+417
| | | | inspired by mdoclint(1), and jmc@ considers it useful
* STYLE message about useless macros we don't want (Bt Tn Ud);schwarze2017-05-302-0/+7
| | | | not a WARNING because they don't endanger portability