summaryrefslogtreecommitdiffstats
path: root/regress/tbl
Commit message (Collapse)AuthorAgeFilesLines
* Provide a new function roff_req_or_macro() to parse and handle a requestIngo Schwarze2022-04-305-6/+62
| | | | | | | | | | | | | | or macro, including context-dependent error handling inside tbl(7) code and inside .ce/.rj blocks. Use it both in the top level roff(7) parser and inside conditional blocks. This fixes an assertion failure triggered by ".if 1 .ce" inside tbl(7) code, found by tb@ using afl(1). As a side benefit for readability, only one place remains in the code that calls the main handler functions for the various roff(7) requests. This patch also improves column numbers in some error messages and various comments.
* At the end of every tbl(7) cell, clear the \z state.Ingo Schwarze2022-04-265-4/+63
| | | | | | | | | This is needed because the TERMP_MULTICOL mode is designed such that term_tbl() buffers all the cells of the table row before the normal reset logic near the end of term_flushln() can be reached. This fixes an assertion failure triggered by \z near the end of a table cell, found by tb@ using afl(1).
* Correctly calculate required column widths for tables containingIngo Schwarze2021-09-072-3/+20
| | | | | | | cells that horizontally span columns which contains "n" (number) formatted cells on other rows. This requires updating total column widths from "n" formatted cells before starting width distribution from the spanning cells to their constituent columns.
* Support two-character font names (BI, CW, CR, CB, CI)Ingo Schwarze2021-08-108-19/+50
| | | | | | | | | | | | | | | | | | | | | | | | 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-2829-116/+0
| | | | output that are no longer printed since man_term.c rev. 1.236
* test font modifiers in the layout; related to tbl_html.c rev. 1.34Ingo Schwarze2021-05-164-2/+49
|
* The GNU tbl(1) program contained in the groff package internallyIngo Schwarze2020-10-256-6/+6
| | | | | | | | | | | | | | | | | | uses roff(7) tabulator settings to implement tables, and it used to leak the changed tabulator settings from tables to the subsequent roff(7) code. In mandoc/tbl_term.c rev. 1.54 (June 17, 2017), code was added to be bug-compatible with groff. In commit d0e03cf6 (Oct 20, 2020), GNU tbl(1) changed behaviour to save the tabulator settings before starting a table and restore them afterwards. Adjust mandoc for compatibility. Since mandoc implements tables without using roff(7) tabulator settings, saving and restoring tabulator settings is not needed in mandoc. Simply deleting the code that changed tabulator settings by reverting tbl_term.c rev. 1.54 is sufficient in mandoc. Also adjust the desired output of the regression tests to match the new behaviour of both groff and mandoc.
* Ignore unreasonably large spacing modifiers in tbl layouts.Ingo Schwarze2020-09-016-4/+120
| | | | | | Jan Schreiber <jes at posteo dot de> ran afl on mandoc and it turned out mandoc tried to use spacing modifiers so large that they would trigger assertion failures in term_ascii.c, function locale_advance().
* test tbl_term.c rev. 1.73 and tbl_data.c rev. 1.53:Ingo Schwarze2020-01-116-11/+39
| | | | | incomplete short layout lines followed by longer lines, and spans at the beginning of layout lines
* Simplify maintainer targets in OpenBSD: EQN and TBL variablesIngo Schwarze2020-01-081-11/+2
| | | | | | no longer exist and NROFF/NOPTS were replaced with GROFF/GOPTS. This doesn't change how things work in the protable version of the test suite.
* When all cells in a tbl(1) column are empty, set the column widthIngo Schwarze2019-12-313-2/+97
| | | | | to 1n rather than to 0n, in the same way as groff does. This fixes misformatting reported by bentley@ in xkeyboard-config(7).
* new test for an empty text block; from rea@ via bapt@ (FreeBSD)Ingo Schwarze2019-07-183-2/+44
|
* Do not access a NULL pointer if a table contains a horizontal lineIngo Schwarze2019-06-113-2/+99
| | | | | | next to a table line having fewer columns than the table as a whole. Bug found by Stephen Gregoratto <dev at sgregoratto dot me> with aerc-config(5).
* Since resetting of offsets works quite differently in man(7) and mdoc(7),Ingo Schwarze2019-01-313-2/+29
| | | | | test table centering in an mdoc(7) document as well. Related to tbl_term.c rev. 1.67.
* It turns out association of tbl spans with layout rows is simpler thanIngo Schwarze2017-07-044-3/+48
| | | | i thought. Fixing a bug in curs_addch(3) and minus 25 lines of code.
* Messages of the -Wbase level now print STYLE:. Since thisIngo Schwarze2017-07-0440-70/+87
| | | | | | | | 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 inter-column spacingIngo Schwarze2017-06-273-1/+33
|
* cope with changes in BASE messagesIngo Schwarze2017-06-259-9/+9
|
* style message about missing RCS ids; inspired by mdoclintIngo Schwarze2017-06-1721-15/+24
|
* tables leak tab settings to subsequent textIngo Schwarze2017-06-1711-0/+41
|
* Multiple tbl(7) improvements:Ingo Schwarze2017-06-165-3/+12052
| | | | | | | | | | | | * Do not discard data that lacks a matching layout cell but remains within the number of columns of the table as a whole. * Do not insert dummy data rows for any layout row starting with a horizontal line, but only for layout rows that would discard all the data on a matching non-empty data row. * Print horizontal lines specified in the layout even if there is no matching data cell. * Improve the logic for extending vertical lines to adjacent rows, for choosing cross marks versus line segments, and some related details.
* round default width of tbl(7) text blocks in the same way as groffIngo Schwarze2017-06-153-1/+166
|
* improve rounding rules for scaling unitsIngo Schwarze2017-06-141-1/+1
| | | | in horizontal orientation in the terminal formatter
* fix the interaction of the allbox option with spanned cells in the layoutIngo Schwarze2017-06-132-0/+18
|
* test the new allbox and wrapping featuresIngo Schwarze2017-06-125-1/+95
|
* Implement w layout specifier (minimum column width).Ingo Schwarze2017-06-083-1/+31
| | | | | Improve width calculation of text blocks. Reduces the groff/mandoc diff in Base+Xenocara by about 800 lines.
* Parser reorg:Ingo Schwarze2017-05-042-3/+3
| | | | | Generate the first node on the roff level: .br Fix some column numbers in diagnostic messages while here.
* When trying to expand some columns in a table where the sum of theIngo Schwarze2017-05-013-1/+39
| | | | | | | widths of the remaining columns is already wider than the line length, underflowing size_t and dying from ENOMEM is the wrong plan. Instead, simply refrain from expanding anything in such a situation, avoiding a crash that tb@ found with afl.
* Really commit some files that failed to get committed in this commit:Ingo Schwarze2017-03-091-0/+1
| | | | | | | Now that markdown output is tested for almost everything, test all 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.
* Finally port the OpenBSD regression suite.Ingo Schwarze2017-02-0854-0/+1329
Both kristaps@ and wiz@ repeated asked for this, literally for years.