Repository navigation
fix: inline formulas render inside HTML table cells - #1373
Open
gennaroprota wants to merge 1 commit into
Open
gennaroprota wants to merge 1 commit into
gennaroprota wants to merge 1 commit into
Conversation
Clang models a `\f$...\f$` formula as a verbatim block command, so the formula ends the paragraph it appears in and the text after it starts a new one. An HTML table with such a formula in a cell was therefore spread over several paragraphs, and the table parser, which looks for `</table>` within one paragraph, warned that the tag was never closed and dropped the table. A Markdown formula (`$...$`) did not split the table, but it came out as plain text, because the traversal that parses inline Markdown never entered table cells. We now gather a paragraph together with the formulas and paragraph remainders that continue it, with no blank line between, before visiting it. The table parser then sees the whole table, and each formula becomes an inline node of its cell. This replaces merging the pieces after the fact, which ignored a blank line before a formula and appended a paragraph that starts with one to the paragraph before it. The traversal now descends into table cells, so their Markdown is parsed and their references are resolved. The AsciiDoc generator emits a formula verbatim, so a `|` in one, as in `\max(|x|, |y|)`, ended the cell. The table template now escapes it. Fixes cppalliance#1370.
Contributor
✨ Highlights
🧾 Changes by Scope
🔝 Top Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1373 +/- ##
========================================
Coverage 83.21% 83.21%
========================================
Files 35 35
Lines 3670 3670
Branches 845 845
========================================
Hits 3054 3054
Misses 410 410
Partials 206 206
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
An automated preview of the documentation is available at https://1373.mrdocs.prtest2.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-10-30 16:24:43 UTC |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An HTML table with a
tag not followed by@f$...@f$formula in a cell was dropped with "HTML</table>within one paragraph. A Markdown formula ($...$) kept the table but stayed plain text, because the doc comment traversal never entered table cells.Changes
\f$formulas and paragraph remainders that continue it (no blank line between), so the table parser sees the whole table and each formula becomes an inline node of its cell. This replaces merging the pieces after the fact, which also appended a paragraph starting with a formula to the paragraph before it, across a blank line. The traversal descends into table cells, so their Markdown is parsed and their references are resolved. The AsciiDoc table template escapes|in a cell, which a formula such as\max(|x|, |y|)would otherwise use to end it.Testing
The new fixture covers the reported table, a Markdown formula in a cell, and paragraphs that start with a formula after a blank line. I checked with Asciidoctor.js that its AsciiDoc table parses into the intended rows and cells.
Documentation
Not needed: the documented behavior of tables and formulas now holds.
Fixes #1370.