Commit 9c7a140
committed
feat: support HTML table tags in doc comments
Previously, an HTML table in a doc comment triggered:
warning: HTML <table> tag not followed by pure text
and then a fatal error: the existing HTML start-tag handler could only
gather pure text between a tag and its matching end tag. The doc-comment
extractor now recognizes `<table>`/`<tr>`/`<th>`/`<td>` and populates
the existing `TableBlock`/`TableRow`/`TableCell` metadata.
The HTML and Adoc generators each gain a doc/block/table partial. The
Adoc output uses the `[%header]` table attribute when the first row is a
header; the HTML output emits plain `<table>`/`<tr>`/`<th>`/`<td>`. The
XML generator already serialized the metadata generically.
Not (yet?) supported:
- HTML attributes on `<table>`/`<tr>`/`<th>`/`<td>` (`align`, `colspan`,
`rowspan`, `class`, `style`, ...). Column alignment is therefore never
populated (`TableBlock::Alignments` is always empty) and cells cannot
span rows or columns.
- `<caption>`, `<col>`, and `<colgroup>`.
- Block-level content inside cells (paragraphs, lists, code blocks).
Cells currently hold only inline content.
Closes issue #1146.1 parent a3366b0 commit 9c7a140
28 files changed
Lines changed: 2474 additions & 1 deletion
File tree
- src/lib/AST
- test-files/golden-tests/javadoc/html-table
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
729 | | - | |
| 729 | + | |
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments