18 Commits
Author SHA1 Message Date
John MacFarlane e96bb43ceb Man reader: allow block-level content in table cells.
Closes #5028.
2018-10-27 23:37:18 -07:00
John MacFarlane 5945c3b011 Man reader: support tables.
Closes #4982.
2018-10-25 22:13:41 -07:00
John MacFarlane bda1c0da81 Man reader: Handle optional argument in ME, UE macros.
Closes #4995.
2018-10-22 23:56:02 -07:00
John MacFarlane 4625150f4c Man reader: fix code block tests.
They incorporated a spurious newline which needs to be
removed.
2018-10-21 23:01:58 -07:00
John MacFarlane 382763a7db Man reader: support .ds, .ds1; also fix macro arguments.
Closes #4997.
2018-10-21 22:00:50 -07:00
John MacFarlane 1238a57456 Man reader: Moved handling of B, I, BI, IB, etc. to parsing phase.
Ultimately groff lexing should not handle man-specific macros.
This approach also gives more correct results for the test case.
2018-10-21 12:43:44 -07:00
John MacFarlane 25248c7a37 Man reader: move macro resolution to lexer phase.
We also introduce a new type ManTokens (a sequence of tokens)
and remove MComment.  This allows lexers to return empty strings
of tokens, or multiple tokens (as when macros are resolved).

One test still fails.  This needs to be fixed by moving handling
of .BI, .I, etc. to the parsing phase.
2018-10-21 12:08:54 -07:00
John MacFarlane 9593b375d7 Man reader: support UR/UE, MT/ME for links.
Closes #4989.
2018-10-20 22:55:20 -07:00
John MacFarlane a9fc71118f Man reader: major restructuring, support macros.
- Improved support for custom macro definitions.
- LinePart type has been added. RoffStr is now one
  constructor of LinePart (the other being MacroArg).
- MComment has lost its argument.
- MEndMacro has been removed.
- MStr has been removed (we now simply use LinePart).
- Macros now store a list of tokens.
- Each macro argument is a [LinePart], instead of a LinePart.
- .BR now behaves as documented in man (and doesn't create a link).
2018-10-20 15:57:34 -07:00
John MacFarlane 8d4027da4d Man reader: block quotes (using RS..RE). 2018-10-20 10:07:28 -07:00
John MacFarlane 1b19e79650 Man reader: parse TP as definition lists.
Closes #4981.
2018-10-20 10:00:50 -07:00
John MacFarlane c60ac7c9ab Man reader: improve treatment of .TH.
This should just add to metadata (title, date, section),
and not produce a level-1 header. (That might be done
in the template, depending on the output format.)
2018-10-19 23:55:01 -07:00
John MacFarlane 7dd06e96d7 Man reader: Improved header parsing.
- .SH should be level 1, .SS level 2.
- The header title can come on the next line.
2018-10-19 23:27:04 -07:00
John MacFarlane f5704fac97 Man reader: properly handle multi-block list items.
Closes #4985.
2018-10-19 22:54:05 -07:00
John MacFarlane 56c4a11f97 Man reader: minor improvements.
use `trimInlines` for Para content to avoid leading and
trailing spaces.

Fix handling of \" in middle of line.

Add more tests for escapes.
2018-10-19 15:17:53 -07:00
John MacFarlane 2ee9cdcc60 Update tests for last change to man reader. 2018-10-19 14:27:13 -07:00
John MacFarlane 400e87df1d Update man reader tests. 2018-10-18 23:54:13 -07:00
Yan Pas 7741cdbf04 added old-style test 2018-10-17 00:21:52 +03:00