| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Skipping such space used to be a bug in GNU tbl(1), and a kludge
was added to mandoc to produce identical output.
The bug was fixed in groff commit 8818c07c Jul 30 2022 gbranden@
https://savannah.gnu.org/bugs/index.php?49390
Consequently, now is the time to get rid of the kludge.
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
designed and written last autumn, polished today
|
|
|
|
|
|
|
|
| |
for centering text spanning multiple tbl(7) columns, correctly account
for the spacing between columns instead of wrongly assuming the default
spacing of 3n.
Patch from Simon Branch <simonmbranch at gmail dot com>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When both the first and the third column are spans, do not use
the number of columns of the span starting in column two
for the span starting in column zero.
With afl, Jan Schreiber <jes at posteo dot de> found cases where
this caused NULL pointer accesses because too many layout cells
were consumed.
While here, make the code more similar at the three places
that iterate over data cells.
|
|
|
|
|
| |
patch from Michal Nowak <mnowak at startmail dot com>
who found these with git pbchk in the illumos tree
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
that bentley@ found in syncthing-bep(7)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sufficient to look at two data rows, but up to three are needed:
the one above to identify vertical lines branching off upward, the
row itself (in case the line is in a data row rather than a layout
line) to figure out the horizontal line style, and the row below
to identify vertical lines branching off downward.
As an example, bentley@ reported from the mpv(1) manual page that
in a tbl(7) having a vertical line in the middle and a horizontal
line in the bottom data row, the vertical line extended below the
bottom horizontal line.
|
|
|
|
|
| |
connects to the horizontally adjacent vertical line or cell;
fixing a bug reported by bentley@.
|
|
|
|
|
|
|
|
|
|
| |
Since resetting of offsets works quite differently in the mdoc(7)
and man(7) formatters, the tbl(7) formatter needs to save the global
offset on entry and restore it on exit. The additional indentation
needed for table centering has to be added to its own offset variable
and applied to each line of the table, rather than only to the first.
Bug found by bentley@ in emulators/fceux(6).
|
|
|
|
|
| |
No need to expose the tbl(7) syntax tree data structures everywhere.
Move them to their own include file, "tbl.h", and improve comments.
|
|
|
|
|
| |
which are requested in the data section rather than in the layout.
Mini-feature found in misc/pfm(1).
|
|
|
|
|
|
|
|
|
|
|
| |
rewrite tbl_hrule() in a simpler way.
Fix several bugs in the process.
No more special flags, just use the existing TBL_OPT_* from mandoc.h.
Reduce the number of tracked rows from three to two, which is more logical:
one above the line and one below is sufficient to figure out crossings.
No more magic quirks, all conditions are readily comprehensible now.
Add comments.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
box drawing characters, U+2500 to U+257F.
Originally suggested by bentley@ four years ago,
reminded this summer by Pali Rohar.
Binary and decimal arithmetics are boring,
so let's use some ternary arithmetics for a change.
That said, some other aspects are too complicated for my liking,
so this could use some polishing in the future.
|
|
|
|
|
|
|
|
|
|
| |
span cells horizontally and vertically as requested by the layout.
Does not handle spans requested in the data section yet.
To be able to do this, record the number of rows spanned
in the first data cell (struct tbl_dat) of a vertical span.
Missing feature reported by Pali dot Rohar at gmail dot com.
|
|
|
|
|
|
| |
as groff, and also honour the explicit alignment indicator "\&".
This required an almost complete rewrite of both the measurement
function and the formatter function for numeric cells.
|
| |
|
| |
|
|
|
|
|
| |
wrapping around to huge numbers and risking memory exhaustion;
fixes Debian ps(1). Bug reported by Dr. Markus Waldeck.
|
|
|
|
|
|
|
|
| |
fixing an assertion failure found by jsg@ with afl(1).
While here, also drop printing of whitespace in tbl_data()
which makes no difference because column positioning code
in term_tbl() already takes care of that.
|
|
|
|
|
| |
this is for example used by lftp(1)
and, ironically, misused by our very own tbl(7) manual...
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
in horizontal orientation in the terminal formatter
|
| |
|
|
|
|
|
|
| |
1. It does not reduce explicit "||" in the layout to "|".
2. It does not cause three horizontal lines at the end of a table,
even if the table ends with an explicit "_" data line.
|
|
|
|
| |
used for example by curs_getch(3) and GLwDrawingArea(3)
|
| |
|
|
|
|
|
| |
inside individual table cells that contain text blocks.
This cures overlong lines in various Xenocara manuals.
|
|
|
|
|
| |
Improve width calculation of text blocks.
Reduces the groff/mandoc diff in Base+Xenocara by about 800 lines.
|
|
|
|
|
|
| |
first step: split column data out of the terminal state struct into
a new column state struct and use an array of such column state
structs. No functional change.
|
|
|
|
|
|
| |
The Tcl/Tk manual pages use this extensively.
Delete the TERM_MAXMARGIN hack, it breaks .mc inside .nf;
instead, implement a proper TERMP_BRNEVER flag.
|
|
|
|
|
|
| |
that were right between two adjacent case statement. Keep only
those 24 where the first case actually executes some code before
falling through to the next case.
|
| |
|
| |
|
|
|
|
|
|
| |
man(7) always prints a blank line, mdoc(7) doesn't.
Problem in mdoc(7) reported by kristaps@.
mdoc(7) part of the patch tested by kristaps@.
|
|
|
|
|
| |
such that that line isn't output with unlimited width.
Problem reported and fix OK by kristaps@.
|
|
|
|
|
|
| |
font stack. The latter fail after the stack is grown with realloc().
Fixing an assertion failure found by jsg@ with afl some time ago
(test case number 51).
|
|
|
|
|
|
|
|
| |
where needed, which is less fragile.
This fixes a subtle NULL pointer access to tp->tbl.cols:
Due to a bug in the man(7) parser, the first span of a table can
end up in a .TP head, in which case tblcalc() was never called.
Found by jsg@ with afl.
|
|
|
|
| |
struct tbl_cell. No functional change, minus 40 lines of code.
|
|
|
|
|
| |
empty-handed; so this is just KNF and some code simplifications,
no functional change.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allow mixing vertical line bars with the layout options
of the preceding layout cell.
* Correctly combine box options with layout lines.
* Correctly print vertical lines in data rows, with the right spacing.
* Correctly print cross markers and left and right ends of
horizontal lines even if vertical lines differ above and below.
* Avoid the bogus error message "no table data cells"
when a table data section starts with a horizontal line.
No increase in code size.
|
|
|
|
|
| |
for a table cell with an "nz" layout specification,
causing essentially infinite output as found by jsg@ with afl.
|
|
|
|
| |
bug reported by bentley@
|
|
|
|
|
|
|
| |
to equalize, maximize, and ignore the width of columns.
Does not yet take vertical rulers into account,
and does not do line breaks within table cells.
Considerably improves the lftp(1) manual; issue noticed by sthen@.
|