summaryrefslogtreecommitdiffstats
path: root/tbl_html.c
Commit message (Collapse)AuthorAgeFilesLines
* Do not write <colgroup> elements. Their only purpose is to enforceIngo Schwarze2018-06-251-9/+0
| | | | | | 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.
* Ignore explicitly specified negative column widths rather thanIngo Schwarze2017-07-311-0/+3
| | | | | wrapping around to huge numbers and risking memory exhaustion; fixes Debian ps(1). Bug reported by Dr. Markus Waldeck.
* fix column width calculation for text block cellsIngo Schwarze2017-06-121-1/+1
|
* Implement w layout specifier (minimum column width).Ingo Schwarze2017-06-081-2/+29
| | | | | Improve width calculation of text blocks. Reduces the groff/mandoc diff in Base+Xenocara by about 800 lines.
* Improve <table> syntax:Ingo Schwarze2017-02-051-2/+3
| | | | | | | | 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.
* Simplify the usage of print_otag() by making it accept a variableIngo Schwarze2017-01-171-21/+9
| | | | | | | | | | 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.
* To make the code more readable, delete 283 /* FALLTHROUGH */ commentsIngo Schwarze2015-10-121-1/+0
| | | | | | 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.
* modernize style: "return" is not a functionIngo Schwarze2015-10-061-2/+3
|
* Delete the redundant tbl span flags, just inspect the actual dataIngo Schwarze2015-01-301-2/+2
| | | | | | | | 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.
* Abolish struct tbl_head and replace it by an "int col" member inIngo Schwarze2015-01-301-7/+7
| | | | struct tbl_cell. No functional change, minus 40 lines of code.
* Auditing the tbl(7) code for more NULL pointer accesses, i came outIngo Schwarze2015-01-301-6/+6
| | | | | empty-handed; so this is just KNF and some code simplifications, no functional change.
* Rudimentary implementation of the e, x, and z table layout modifiersIngo Schwarze2014-10-141-1/+1
| | | | | | | 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@.
* Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.Ingo Schwarze2014-08-101-2/+2
| | | | | | Include <sys/types.h> where needed, it does not belong in config.h. Remove <stdio.h> from config.h; if it is missing somewhere, it should be added, but i cannot find a *.c file where it is missing.
* KNF: case (FOO): -> case FOO:, remove /* LINTED */ and /* ARGSUSED */,Ingo Schwarze2014-04-201-5/+4
| | | | | remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
* Do not handle vertical lines as additional tbl(7) columns,Ingo Schwarze2012-05-271-13/+5
| | | | | | | | | | | | | | | | 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(). "Please check them in and I'll look into them later!" kristaps@
* forgotten Copyright bumps; no code changeIngo Schwarze2011-09-181-1/+1
| | | | found while syncing to OpenBSD
* Fix copyright email.Kristaps Dzonsons2011-07-171-1/+1
|
* Change how -Thtml behaves with tables: use multiple rows, with widthsKristaps Dzonsons2011-01-131-44/+61
| | | | | | | | | 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@.
* Add support for "^" vertical spanners. Unlike GNU tbl, raiseKristaps Dzonsons2011-01-111-3/+11
| | | | | | | error-class messages when data is being ignored by specifying it in "^" cells (either as-is or in blocks). Also note again that horizontal spanners aren't really supported...
* Restructured tbl_html() function so that we always clean up our columns.Kristaps Dzonsons2011-01-061-39/+42
|
* Make -T[x]html for tables structure cells with a width. I don'tKristaps Dzonsons2011-01-061-1/+48
| | | | | | | anticipate doing much more than this for the coming release. Also, remove "base" part of struct html (not used anywhere) and put some comments in struct html.h.
* Give tables an HTML class.Kristaps Dzonsons2011-01-051-2/+5
|
* Support `T{' and `T}' data blocks. When a standalone `T{' isKristaps Dzonsons2011-01-041-1/+2
| | | | | | | encountered as a line's last data cell, move into TBL_PART_CDATA mode whilst leaving the cell's designation as TBL_DATA_NONE. When new data arrives that's not a standalone `T}', append it to the cell contends. Close out and warn appropriately.
* Add skeleton for -T[x]html tbl stuff. Also start to put in some bits aboutKristaps Dzonsons2011-01-041-0/+72
the up-coming version, although we're not quite there yet.