Up to [local] / src / usr.bin / mandoc
Request diff between arbitrary revisions
Default branch: MAIN
Revision 1.35 / (download) - annotate - [select for diffs], Sat Apr 23 13:58:09 2022 UTC (2 years ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE,
OPENBSD_7_5,
OPENBSD_7_4_BASE,
OPENBSD_7_4,
OPENBSD_7_3_BASE,
OPENBSD_7_3,
OPENBSD_7_2_BASE,
OPENBSD_7_2,
HEAD
Changes since 1.34: +5 -3 lines
Diff to previous 1.34 (colored)
If the last data row of a tbl(7) contains nothing but a horizontal line, do not skip closing the table and cleaning up memory at the end of the table in the HTML output module. This bug resulted in skipping the tblcalc() function and reusing the existing roffcol array for the next tbl(7) processed. If the next table had more columns than the one ending with a horizontal line in the last data row, uninitialized memory was read, potentially resulting in near-infinite output. The bug was introduced in rev. 1.24 (2018/11/26) but only fully exposed by rev. 1.33 (2021/09/09). Until rev. 1.32, it could only cause misformatting and invalid HTML output syntax but not huge output because up to that point, the function did not use the roffcol array. Nasty bug found the hard way by Michael Stapelberg on the production server manpages.debian.org. Michael also supplied example files and excellent instructions how to reproduce the bug, which was very difficult because no real-world manual page is known that triggers the bug by itself, so to reproduce the bug, mandoc(1) had to be invoked with at least two file name arguments.
Revision 1.34 / (download) - annotate - [select for diffs], Wed Jan 12 04:43:21 2022 UTC (2 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE,
OPENBSD_7_1
Changes since 1.33: +4 -2 lines
Diff to previous 1.33 (colored)
According to the tbl(7) manual, if a data cell contains only the two character sequence "\_" or "\=", a single or double horizontal line is supposed to be drawn inside the cell, not joining its neighbours. I am not aware of any way to do that with HTML and/or CSS. Still, it seems closer to the intent of the document author to draw a horizontal line with <hr/>, even though that line will join the neighbour cells, rather than printing a literal '_' or '=' character. Formatting tweak inspired by a related question from Ted Bullock <tbullock at comlore dot com>.
Revision 1.33 / (download) - annotate - [select for diffs], Thu Sep 9 16:50:57 2021 UTC (2 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE,
OPENBSD_7_0
Changes since 1.32: +25 -1 lines
Diff to previous 1.32 (colored)
In HTML output, in cells with an "n" (number) layout, pad numbers on the right side with UTF-8 punctuation and figure spaces such that numbers in different tbl(7) rows align at the decimal point. The exact HTML output format was suggested by <Oliver dot Corff at email dot de>; the implementation in C is mine.
Revision 1.32 / (download) - annotate - [select for diffs], Thu Sep 9 14:45:18 2021 UTC (2 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.31: +7 -2 lines
Diff to previous 1.31 (colored)
If the layout or data of an individual cell in a tbl(7) contains only "_", "-", or "=", requesting a horizontal line to be drawn across the middle of the cell, print <hr/> in that cell in HTML output. That is arguably slightly ugly because HTML 5 regards <hr/> as semantic markup, meaning "thematic break". If somebody knowns a better way to render a horizontal line across the middle of a table cell with pure HTML and CSS, and without implying a specific meaning, please tell me. Missing feature reported by <Oliver dot Corff at email dot de>.
Revision 1.31 / (download) - annotate - [select for diffs], Tue Aug 10 12:36:42 2021 UTC (2 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.30: +2 -5 lines
Diff to previous 1.30 (colored)
Support two-character font names (BI, CW, CR, CB, CI) 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.
Revision 1.30 / (download) - annotate - [select for diffs], Sun May 16 23:16:22 2021 UTC (3 years ago) by schwarze
Branch: MAIN
Changes since 1.29: +3 -1 lines
Diff to previous 1.29 (colored)
Implement the layout specification "a" (left justify with 1em indentation) in HTML output mode; before this patch, the indentation was missing. Terminal output already supported the "a" specifier since 2010. Issue reported and patch tested by Oliver dot Corff at email dot de.
Revision 1.29 / (download) - annotate - [select for diffs], Sun May 16 18:08:37 2021 UTC (3 years ago) by schwarze
Branch: MAIN
Changes since 1.28: +11 -3 lines
Diff to previous 1.28 (colored)
implement the tbl(7) layout modifiers "b" (bold) and "i" (italic) in HTML output mode, similar to tbl_term.c, function tbl_word(); issue reported by Oliver dot Corff at email dot de
Revision 1.28 / (download) - annotate - [select for diffs], Sun Mar 17 18:20:07 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE,
OPENBSD_6_9,
OPENBSD_6_8_BASE,
OPENBSD_6_8,
OPENBSD_6_7_BASE,
OPENBSD_6_7,
OPENBSD_6_6_BASE,
OPENBSD_6_6,
OPENBSD_6_5_BASE,
OPENBSD_6_5
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)
The header file "html.h" uses enum roff_tok, so "roff.h" must be included before it. Diff from bcallah@ tweaked by me; he found the bug by compiling with pcc.
Revision 1.27 / (download) - annotate - [select for diffs], Sun Jan 6 04:41:15 2019 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.26: +2 -1 lines
Diff to previous 1.26 (colored)
Finally, represent the man(7) .PP and .HP macros by the natural 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.
Revision 1.26 / (download) - annotate - [select for diffs], Sat Dec 15 23:33:20 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.25: +2 -1 lines
Diff to previous 1.25 (colored)
Yet another round of improvements to manual font selection. 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.
Revision 1.25 / (download) - annotate - [select for diffs], Wed Dec 12 21:54:30 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)
Cleanup, no functional change: No need to expose the tbl(7) syntax tree data structures everywhere. Move them to their own include file, "tbl.h", and improve comments.
Revision 1.24 / (download) - annotate - [select for diffs], Mon Nov 26 21:05:54 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +123 -67 lines
Diff to previous 1.23 (colored)
Implement tbl(7) lines in -T html output, as far as they are on the edges of table cells rather than going through the middle of cells: * the box, doublebox, and allbox options; * the | and || layout modifiers; * and the _ and = data lines; - but not yet _ and = in individual layout and data cells. Missing feature reported by Pali dot Rohar at gmail dot com.
Revision 1.23 / (download) - annotate - [select for diffs], Mon Nov 26 01:51:41 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.22: +5 -17 lines
Diff to previous 1.22 (colored)
Simplify writing of tbl(7) cells by using the new feature of passing a NULL pointer for the value of a style attribute, in which case the attribute is omitted from the HTML element. Minus 12 lines of ugly and repetitive code, no functional change.
Revision 1.22 / (download) - annotate - [select for diffs], Sun Nov 25 21:17:30 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.21: +12 -7 lines
Diff to previous 1.21 (colored)
Let cells containing nothing but \^ extend the cell above. Missing feature reported by Pali dot Rohar at gmail dot com.
Revision 1.21 / (download) - annotate - [select for diffs], Sun Nov 25 19:23:59 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.20: +40 -17 lines
Diff to previous 1.20 (colored)
In tbl(7) -T html output, 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.
Revision 1.20 / (download) - annotate - [select for diffs], Sat Nov 24 23:03:13 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.19: +36 -6 lines
Diff to previous 1.19 (colored)
Implement horizontal and vertical alignment of tbl(7) cell content in -T html output. This does not handle spanned cells yet. Missing feature reported by Pali dot Rohar at gmail dot com.
Revision 1.19 / (download) - annotate - [select for diffs], Mon Jun 25 13:46:01 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE,
OPENBSD_6_4
Changes since 1.18: +1 -10 lines
Diff to previous 1.18 (colored)
Do not write <colgroup> elements. Their only purpose is to enforce author-specified column widths, which can harm responsive design and provide no real benefit: HTML rendering engines usually do just fine automatically selecting appropriate column widths.
Revision 1.18 / (download) - annotate - [select for diffs], Mon Jul 31 16:14:04 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE,
OPENBSD_6_3,
OPENBSD_6_2_BASE,
OPENBSD_6_2
Changes since 1.17: +4 -1 lines
Diff to previous 1.17 (colored)
Ignore explicitly specified negative column widths rather than wrapping around to huge numbers and risking memory exhaustion; fixes Debian ps(1). Bug reported by Dr. Markus Waldeck.
Revision 1.17 / (download) - annotate - [select for diffs], Mon Jun 12 20:14:03 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)
fix column width calculation for text block cells
Revision 1.16 / (download) - annotate - [select for diffs], Thu Jun 8 18:11:15 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.15: +30 -3 lines
Diff to previous 1.15 (colored)
Implement w layout specifier (minimum column width). Improve width calculation of text blocks. Reduces the groff/mandoc diff in Base+Xenocara by about 800 lines.
Revision 1.15 / (download) - annotate - [select for diffs], Sun Feb 5 18:13:28 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE,
OPENBSD_6_1
Changes since 1.14: +4 -3 lines
Diff to previous 1.14 (colored)
Improve <table> syntax: The <col> element can only appear inside <colgroup>, so use <colgroup>. The <tbody> element is optional and useless, so don't use it. Even if we would ever need <thead> or <tfoot>, <tbody> would still be optional and useless; besides, we will likely never need <thead> or <tfoot>, simply because our languages don't support such functionality.
Revision 1.14 / (download) - annotate - [select for diffs], Tue Jan 17 01:47:46 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.13: +9 -21 lines
Diff to previous 1.13 (colored)
Simplify the usage of print_otag() by making it accept a variable number of arguments. Delete struct htmlpair and all the PAIR_*() macros. Delete enum htmlattr, handle that in print_otag() instead. Minus 190 lines of code; no functional change except better ordering of attributes (class before style) in three cases.
Revision 1.13 / (download) - annotate - [select for diffs], Mon Oct 12 00:07:27 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE,
OPENBSD_6_0,
OPENBSD_5_9_BASE,
OPENBSD_5_9
Changes since 1.12: +1 -2 lines
Diff to previous 1.12 (colored)
To make the code more readable, delete 283 /* FALLTHROUGH */ comments 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.
Revision 1.12 / (download) - annotate - [select for diffs], Tue Oct 6 18:30:44 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.11: +4 -3 lines
Diff to previous 1.11 (colored)
modernize style: "return" is not a function; ok cmp(1)
Revision 1.11 / (download) - annotate - [select for diffs], Fri Jan 30 17:31:20 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE,
OPENBSD_5_8,
OPENBSD_5_7_BASE,
OPENBSD_5_7
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)
Delete the redundant tbl span flags, just inspect the actual data 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.
Revision 1.10 / (download) - annotate - [select for diffs], Fri Jan 30 04:08:37 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.9: +8 -8 lines
Diff to previous 1.9 (colored)
Abolish struct tbl_head and replace it by an "int col" member in struct tbl_cell. No functional change, minus 40 lines of code.
Revision 1.9 / (download) - annotate - [select for diffs], Fri Jan 30 02:08:37 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.8: +7 -7 lines
Diff to previous 1.8 (colored)
Auditing the tbl(7) code for more NULL pointer accesses, i came out empty-handed; so this is just KNF and some code simplifications, no functional change.
Revision 1.8 / (download) - annotate - [select for diffs], Tue Oct 14 02:16:02 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.7: +4 -2 lines
Diff to previous 1.7 (colored)
Rudimentary implementation of the e, x, and z table layout modifiers 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@.
Revision 1.7 / (download) - annotate - [select for diffs], Sun Apr 20 16:44:44 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE,
OPENBSD_5_6
Changes since 1.6: +5 -10 lines
Diff to previous 1.6 (colored)
KNF: case (FOO): -> case FOO, remove /* LINTED */ and /* ARGSUSED */, remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
Revision 1.6 / (download) - annotate - [select for diffs], Sat May 26 20:03:34 2012 UTC (11 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE,
OPENBSD_5_5,
OPENBSD_5_4_BASE,
OPENBSD_5_4,
OPENBSD_5_3_BASE,
OPENBSD_5_3,
OPENBSD_5_2_BASE,
OPENBSD_5_2
Changes since 1.5: +6 -14 lines
Diff to previous 1.5 (colored)
Do not handle vertical lines as additional tbl(7) columns, instead save their properties with the following column. This simplifies layout parsing and saves a lot of code related to column handling. At output time, print all white space and vertical lines separating columns before printing the following column, and none after printing the preceding column, considerably simplifying white space handling and width calculations. No functional change, but it saves 150 lines of code, and it allows the next patch to tbl_term.c, tbl_literal().
Revision 1.5 / (download) - annotate - [select for diffs], Sun Sep 18 15:54:48 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE,
OPENBSD_5_1
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)
sync to version 1.11.7 from kristaps@ main new feature: support the roff(7) .tr request plus various bugfixes and some refactoring regressions are so minor that it's better to get this in and fix them in the tree
Revision 1.4 / (download) - annotate - [select for diffs], Sun Jan 16 19:41:16 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE,
OPENBSD_5_0,
OPENBSD_4_9_BASE,
OPENBSD_4_9
Changes since 1.3: +62 -45 lines
Diff to previous 1.3 (colored)
Merge from bsd.lv, original commit message by kristaps@: Change how -Thtml behaves with tables: use multiple rows, with widths set by COL, until an external macro is encountered. At this point in time, close out the table and process the macro. When the first table row is again re-encountered, re-start the table. This requires a bit of tracking added to "struct html", but the change is very small and follows the logic of meta-fonts. This all follows a bug-report by joerg@.
Revision 1.3 / (download) - annotate - [select for diffs], Sun Jan 16 01:11:50 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.2: +12 -4 lines
Diff to previous 1.2 (colored)
Various tbl improvements from kristaps@: * horizontal lines do not consume layout lines * skip excessive data cells * prepare rendering of spanned cells * support vertical spans
Revision 1.2 / (download) - annotate - [select for diffs], Sun Jan 9 14:30:48 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.1: +80 -27 lines
Diff to previous 1.1 (colored)
Sync tbl handling to bsd.lv release 1.10.9: * .T} can be followed by a delimiter, then more data. * Do not limit table column widths (improves terminfo(5)). * Let numerical cells respect explicitly specified minimum cell widths. * Let terminal output survive missing data cells. * Parse and ignore arguments in parentheses on layout cell specifications. * Move tbl_calc() into out.c such that it can be used by all frontends. * Give tables an HTML class. * Some cleanup in tbl -Thtml code. All code by kristaps@.
Revision 1.1 / (download) - annotate - [select for diffs], Tue Jan 4 22:28:17 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Merge kristaps@' cleaner tbl integration, removing mine; there are still a few bugs, but fixing these will be easier in tree.