summaryrefslogtreecommitdiffstats
path: root/regress/roff/esc
Commit message (Collapse)AuthorAgeFilesLines
* Adjust desired output after the bugfix man.c rev. 1.189.Ingo Schwarze2022-08-161-1/+1
| | | | The new version of the output file was generated with groff-current.
* Surprisingly, every escape sequence can also be used as an argumentIngo Schwarze2022-06-0818-23/+724
| | | | | | | delimiter for an outer escape sequence, in which case the delimiting escape sequence retains its syntax but usually ignores its argument and loses its inherent effect. Add rudimentary support for this syntax quirk in order to improve parsing compatibility with groff.
* Split the excessively generic diagnostic message "invalid escape sequence"Ingo Schwarze2022-06-075-8/+8
| | | | | into the more specific messages "invalid escape argument delimiter" and "invalid escape sequence argument".
* With the improved escape sequence parser, it becomes easy to also improveIngo Schwarze2022-06-055-40/+40
| | | | | | | | | diagnostics. Distinguish "incomplete escape sequence", "invalid special character", and "unknown special character" from the generic "invalid escape sequence", also promoting them from WARNING to ERROR because incomplete escape sequences are severe syntax violations and because encountering an invalid or unknown special character makes it likely that part of the document content intended by the authors gets lost.
* Dummy implementation of the roff(7) \V (interpolate environment variable)Ingo Schwarze2022-05-304-3/+32
| | | | | | | | | escape sequence. This is needed to get \V into the correct parsing class, ESCAPE_EXPAND. It is intentional that mandoc(1) output is *not* influenced by environment variables, so interpolate the name of the variable with some decorating punctuation rather than interpolating its value.
* Re-classify the roff(7) \r (reverse line feed) escape sequenceIngo Schwarze2022-05-204-5/+31
| | | | | | | from "ignore" to "unsupported" because when an input file uses it, mandoc(1) is likely to significantly misformat the output, usually showing parts of the output in a different order than the author intended.
* Test the handling of some additional one-character escape sequencesIngo Schwarze2022-05-203-13/+43
| | | | | that take no argument and are ignored: \% \& \^ \a \d \t \u \{ \| \} No change to parsing or formatting needed.
* following the fixed parsing direction of roff_expand() in roff.c rev. 1.388,Ingo Schwarze2022-05-192-24/+24
| | | | some diagnostics now appear in a more reasonable order, too
* fix a wrong column number that got fixed as a side effectIngo Schwarze2022-05-191-1/+1
| | | | of the roff_expand() reorganization in roff.c rev. 1.388
* Split a new function roff_parse_comment() out of roff_expand() because thisIngo Schwarze2022-05-014-3/+48
| | | | | | | functionality is not needed when called from roff_getarg(). This makes the long and complicated function roff_expand() significantly shorter, and also simpler in so far as it no longer needs to return ROFF_APPEND. No functional change intended.
* Fix three bugs regarding the interaction of \z and \h:Ingo Schwarze2022-04-275-4/+41
| | | | | | | | | | | | | | | | | | | | 1. The combination \z\h is a no-op whatever the argument may be. In the past, the \z only affected the first space character generated by the \h, which was wrong. 2. For the conbination \zX\h with a positive argument, the first space resulting from the \h is not printed but consumed by the \z. 3. For the combination \zX\h with a negative argument, application of the \z needs to be completed before the \h can be started. In the past, if this combination occurred at the beginning of an output line, the \h backed up to the beginning of the line and after that, the \z attempted to back up even further, triggering an assertion. Bugs found during an audit of assignments to termp->col that i started after the bugfix tbl_term.c rev. 1.65. The assertion triggered by bug 3 was *not* yet found by afl(1).
* Surprisingly, groff supports multiple copy mode escapes at theIngo Schwarze2022-04-133-2/+50
| | | | | | | | | | | | | beginning of an escape sequence: \, \E, \EE, \EEE, and so on all do the same outside copy mode, so let them do the same in mandoc(1), too. This fixes an assertion failure triggered by \EE*X that tb@ found with afl(1). The first E was consumed by roff_expand(), but that function failed to recognize the escape sequence as the expansion of a user-defined string and handed it over to mandoc_escape(), which consumed the second E and then died on an assertion because it is not prepared to handle user-defined strings. Fix this by letting *both* functions handle arbitrary numbers of 'E's correctly.
* Support two-character font names (BI, CW, CR, CB, CI)Ingo Schwarze2021-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | in the tbl(7) layout font modifier. Get rid of the TBL_CELL_BOLD and TBL_CELL_ITALIC flags and use the usual ESCAPE_FONT* enum mandoc_esc members from mandoc.h instead, which simplifies and unifies some code. While here, also support CB and CI in roff(7) \f escape sequences and in roff(7) .ft requests for all output modes. Using those is certainly not recommended because portability is limited even with groff, but supporting them makes some existing third-party manual pages look better, in particular in HTML output mode. Bug-compatible with groff as far as i'm aware, except that i consider font names starting with the '\n' (ASCII 0x0a line feed) character so insane that i decided to not support them. Missing feature reported by nabijaczleweli dot xyz in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992002. I used none of the code from the initial patch submitted by nabijaczleweli, but some of their ideas. Final patch tested by them, too.
* delete the two pairs of extra blank lines from expected man(7) terminalIngo Schwarze2021-06-288-32/+0
| | | | output that are no longer printed since man_term.c rev. 1.236
* Rename syntax test of the \O escape sequence (suppress output groffIngo Schwarze2020-12-216-26/+26
| | | | | | extension; mandoc only implements syntax checking but ignores the sequence) to please Bill Gates and didickman@: avoid path names that only differ by case, like o.in vs. O.in.
* adapt to new <p> output logic (html.c rev. 1.260)Ingo Schwarze2019-09-031-2/+0
|
* Test handling of escaped backslashes because the code related toIngo Schwarze2019-01-175-2/+97
| | | | copy mode is complicated and prone to regressions.
* Yet another round of improvements to manual font selection.Ingo Schwarze2018-12-164-18/+31
| | | | | | | | | 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. In regress.pl, only strip leading whitespace in math mode.
* Several improvements to escape sequence handling.Ingo Schwarze2018-12-1515-38/+218
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* If man(7) next-line scope is open and the line ends with \c,Ingo Schwarze2018-08-252-3/+29
| | | | the scope remains open. Needed for example for groff_man(7).
* catch up with ASCII renderings in chars.c rev. 1.72Ingo Schwarze2017-08-232-10/+14
|
* Messages of the -Wbase level now print STYLE:. Since thisIngo Schwarze2017-07-0434-63/+63
| | | | | | | | 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.
* cope with changes in BASE messagesIngo Schwarze2017-06-255-10/+15
|
* style message about missing RCS ids; inspired by mdoclintIngo Schwarze2017-06-175-0/+5
|
* correct handling of blank lines after \cIngo Schwarze2017-06-174-0/+25
|
* implement so-called absolute horizontal motion: \h'|...',Ingo Schwarze2017-06-143-1/+4
| | | | used for example by zoem(1)
* let \l use the right fill characterIngo Schwarze2017-06-144-2/+42
|
* improve rounding rules for scaling unitsIngo Schwarze2017-06-143-1/+4
| | | | in horizontal orientation in the terminal formatter
* implement the roff(7) \p (break output line) escape sequenceIngo Schwarze2017-06-143-1/+35
|
* Style message about legacy man(7) date format in mdoc(7) documentsIngo Schwarze2017-06-114-0/+4
| | | | | and operating system dependent messages about missing or unexpected Mdocdate; inspired by mdoclint(1).
* Minimal implementation of the \h (horizontal motion) escape sequence.Ingo Schwarze2017-06-011-2/+2
| | | | Good enough to cope with the average DocBook insanity.
* Many people have been complaining for a long time that ``...'' looksIngo Schwarze2017-02-171-1/+1
| | | | | | | | | | | ugly in -Tascii output. For that reason, bentley@ submitted patches to render "..." instead to groff in November 2014 (yes, more than two years ago). Carsten Kunze yesterday merged them for the upcoming groff-1.22.4 release. Yay! Consequently, do the same in mandoc: Render \(Lq and \(Rq (which are used for .Do, .Dq, .Lb, and .St) as '"' in -Tascii output. All other output modes including -Tutf8 remain unchanged.
* Finally port the OpenBSD regression suite.Ingo Schwarze2017-02-0831-0/+488
Both kristaps@ and wiz@ repeated asked for this, literally for years.