Skip to content

fix: render inline markup correctly in Adoc and HTML#1186

Open
gennaroprota wants to merge 1 commit into
cppalliance:developfrom
gennaroprota:fix/restore_em_mark_sub_sup_del_in_html_output
Open

fix: render inline markup correctly in Adoc and HTML#1186
gennaroprota wants to merge 1 commit into
cppalliance:developfrom
gennaroprota:fix/restore_em_mark_sub_sup_del_in_html_output

Conversation

@gennaroprota

@gennaroprota gennaroprota commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Note: Rebased onto current develop, where highlight and strikethrough already rendered correctly, so this PR now covers the remaining three kinds. It also documents subscript and superscript in the inline-commands reference with runnable examples.


Five kinds of inline markup in doc comments (emphasis, highlight, subscript, superscript, and strikethrough) were not rendered correctly:

  • HTML output silently dropped the wrapping element, so emphasized text and the others appeared as bare text.
  • AsciiDoc output rendered all five as italics, which is correct for emphasis but semantically wrong for the others (e.g., a subscript appeared as italic text, not lowered).

Both rendering paths now produce semantically appropriate markup: <em>, <mark>, <sub>, <sup>, <del> in HTML, and the matching constructs in AsciiDoc (with strikethrough using the role-based [.line-through]#...#, since AsciiDoc has no native syntax for it).

Doc comments may now also use the HTML-tag form for these kinds (<strong>, <mark>, <del>, <s>, <sub>, <sup>) alongside the previously-supported <em>. This is what most users reach for when they need a tight notation (e.g., H<sub>2</sub>O); the Markdown-marker forms (~text~, ^text^, ==text==, ~~text~~) require whitespace flanks, which makes compact chemistry/math notation awkward.

Three other inline kinds (footnote-reference, image, and math) suffer from the same rendering issue but each requires its own non-trivial design decision and is left for separate fixes.

Closes issue #1185.

@github-actions

github-actions Bot commented Apr 29, 2026

Copy link
Copy Markdown

ℹ️ Info

Note

PR description is missing template sections: Changes, Testing, Documentation. Following the pull request template helps reviewers find rationale, testing notes, and docs status quickly.

✨ Highlights

  • 🧪 Existing golden tests changed (behavior likely shifted)

🧾 Changes by Scope

Scope Lines Δ% Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🥇 Golden Tests 80% 291 287 4 9 5 4 - -
🛠️ Source 16% 59 49 10 13 4 8 - 1
📄 Docs 4% 16 10 6 2 - 2 - -
Total 100% 366 346 20 24 9 14 - 1

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

🔝 Top Files

  • test-files/golden-tests/javadoc/inline/inline-markers.xml (Golden Tests): 181 lines Δ (+181 / -0)
  • test-files/golden-tests/javadoc/inline/inline-markers.html (Golden Tests): 48 lines Δ (+48 / -0)
  • test-files/golden-tests/javadoc/inline/inline-markers.adoc (Golden Tests): 38 lines Δ (+38 / -0)

Generated by 🚫 dangerJS against a14d2e6

@codecov

codecov Bot commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.16%. Comparing base (197e765) to head (a14d2e6).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1186   +/-   ##
========================================
  Coverage    83.16%   83.16%           
========================================
  Files           35       35           
  Lines         3658     3658           
  Branches       843      843           
========================================
  Hits          3042     3042           
  Misses         409      409           
  Partials       207      207           
Flag Coverage Δ
bootstrap 83.16% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@cppalliance-bot

cppalliance-bot commented Apr 29, 2026

Copy link
Copy Markdown

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

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

2026-06-25 08:51:01 UTC

@gennaroprota gennaroprota force-pushed the fix/restore_em_mark_sub_sup_del_in_html_output branch from f0c0ddb to 35d81dc Compare April 29, 2026 14:00
@gennaroprota gennaroprota force-pushed the fix/restore_em_mark_sub_sup_del_in_html_output branch from 35d81dc to 15094a7 Compare June 4, 2026 06:59
@alandefreitas

Copy link
Copy Markdown
Collaborator

This is really nice. I think it's going to need a rebase because a few kinds of inline comments have already been fixed since then. We'll also need the examples for the new reference pages that didn't exist 40 days ago.

Emphasis, subscript, and superscript in doc comments rendered
incorrectly. Their common partials all delegated to the italic fallback
`markup/i`. In AsciiDoc that yields italics: right for emphasis, wrong
for subscript and superscript, which should be lowered and raised. In
HTML `markup/i` has no counterpart, so emphasis collapsed to bare text;
and the HTML inline dispatcher was a hardcoded list that omitted
subscript and superscript, dropping them altogether.

Doc comments may now also use the HTML-tag form for the
inline-formatting kinds (`<strong>`, `<mark>`, `<del>`, `<s>`, `<sub>`,
`<sup>`), joining the previously-supported `<em>`. This is what most
users reach for when they need tight notation (e.g. `H<sub>2</sub>O`);
the Markdown-marker forms require whitespace flanks, which makes compact
chemistry and math notation awkward.

Footnote-reference, image, and math share the same italic-fallback
rendering but each needs its own design decision and is left for
separate fixes.

Closes issue cppalliance#1185.
@gennaroprota gennaroprota force-pushed the fix/restore_em_mark_sub_sup_del_in_html_output branch from 15094a7 to a14d2e6 Compare June 25, 2026 08:43
@gennaroprota gennaroprota linked an issue Jun 25, 2026 that may be closed by this pull request
@gennaroprota gennaroprota changed the title fix: render inline markup correctly in HTML and Adoc fix: render inline markup correctly in Adoc and HTML Jun 25, 2026
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.

HTML output lacks <em> , <mark>, <sub>, <sup>, <del>

3 participants