Skip to content

feat: support HTML table tags in doc comments#1183

Merged
gennaroprota merged 1 commit intocppalliance:developfrom
gennaroprota:feat/support_html_table_tags_in_doc_comments
Apr 29, 2026
Merged

feat: support HTML table tags in doc comments#1183
gennaroprota merged 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 -
🥇 Golden Tests 83% 2057 2057 - 24 24 - - -
🛠️ Source 17% 416 416 - 3 2 1 - -
🏗️ Build <1% 2 1 1 1 - 1 - -
Total 100% 2475 2474 1 28 26 2 - -

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

🔝 Top Files

  • src/lib/AST/ExtractDocComment.cpp (Source): 407 lines Δ (+407 / -0)
  • test-files/golden-tests/javadoc/html-table/edge-cases.xml (Golden Tests): 184 lines Δ (+184 / -0)
  • test-files/golden-tests/javadoc/html-table/grouped.xml (Golden Tests): 179 lines Δ (+179 / -0)

Generated by 🚫 dangerJS against acd3216

@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-28 13:29:01 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 98.85714% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.19%. Comparing base (a3366b0) to head (acd3216).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
src/lib/AST/ExtractDocComment.cpp 98.85% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1183      +/-   ##
===========================================
+ Coverage    78.82%   79.19%   +0.37%     
===========================================
  Files          308      308              
  Lines        32157    32332     +175     
  Branches      6456     6493      +37     
===========================================
+ Hits         25347    25606     +259     
+ Misses        4446     4355      -91     
- Partials      2364     2371       +7     
Flag Coverage Δ
bootstrap 81.89% <ø> (ø)
cpp 78.92% <98.85%> (+0.41%) ⬆️

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

@gennaroprota gennaroprota force-pushed the feat/support_html_table_tags_in_doc_comments branch 5 times, most recently from c591884 to 59071cd Compare April 28, 2026 10:28
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 59071cd to acd3216 Compare April 28, 2026 13:19
@gennaroprota gennaroprota merged commit 9c7a140 into cppalliance:develop Apr 29, 2026
33 checks passed
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