Skip to content

feat: support HTML table tags in doc comments#1183

Open
gennaroprota wants to merge 1 commit intocppalliance:developfrom
gennaroprota:feat/support_html_table_tags_in_doc_comments
Open

feat: support HTML table tags in doc comments#1183
gennaroprota wants to merge 1 commit intocppalliance:developfrom
gennaroprota:feat/support_html_table_tags_in_doc_comments

Conversation

@gennaroprota
Copy link
Copy Markdown
Collaborator

@gennaroprota gennaroprota commented Apr 23, 2026

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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

🚧 Danger.js checks for MrDocs are experimental; expect some rough edges while we tune the rules.

✨ Highlights

  • 🧪 New golden tests added

🧾 Changes by Scope

Scope Lines Δ% Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🛠️ Source 54% 403 403 - 3 2 1 - -
🥇 Golden Tests 46% 340 340 - 4 4 - - -
🏗️ Build <1% 2 1 1 1 - 1 - -
Total 100% 745 744 1 8 6 2 - -

Legend: Files + (added), Files ~ (modified), Files ↔ (renamed), Files - (removed)

🔝 Top Files

  • src/lib/AST/ExtractDocComment.cpp (Source): 394 lines Δ (+394 / -0)
  • test-files/golden-tests/javadoc/html-table/html-table.xml (Golden Tests): 175 lines Δ (+175 / -0)
  • test-files/golden-tests/javadoc/html-table/html-table.html (Golden Tests): 86 lines Δ (+86 / -0)

Generated by 🚫 dangerJS against 71c4f5e

@cppalliance-bot
Copy link
Copy Markdown

cppalliance-bot commented Apr 23, 2026

An automated preview of the documentation is available at https://1183.mrdocs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-04-24 14:14:06 UTC

@gennaroprota gennaroprota force-pushed the feat/support_html_table_tags_in_doc_comments branch from dea61b5 to 33c2669 Compare April 23, 2026 13:15
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 52.63158% with 81 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.88%. Comparing base (a3366b0) to head (71c4f5e).

Files with missing lines Patch % Lines
src/lib/AST/ExtractDocComment.cpp 52.63% 62 Missing and 19 partials ⚠️

❌ Your patch check has failed because the patch coverage (52.63%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1183      +/-   ##
===========================================
+ Coverage    78.82%   78.88%   +0.06%     
===========================================
  Files          308      308              
  Lines        32157    32328     +171     
  Branches      6456     6491      +35     
===========================================
+ Hits         25347    25503     +156     
+ Misses        4446     4432      -14     
- Partials      2364     2393      +29     
Flag Coverage Δ
bootstrap 81.89% <ø> (ø)
cpp 78.58% <52.63%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gennaroprota gennaroprota force-pushed the feat/support_html_table_tags_in_doc_comments branch from 33c2669 to 26b6c9b Compare April 23, 2026 13:24
Copy link
Copy Markdown
Collaborator

@alandefreitas alandefreitas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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 cppalliance#1146.
@gennaroprota gennaroprota force-pushed the feat/support_html_table_tags_in_doc_comments branch from 26b6c9b to 71c4f5e Compare April 24, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants