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.
Read tables back as Markdown instead of smearing their cells #650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: composer-reset-keeps-mode
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Read tables back as Markdown instead of smearing their cells #650
Changes from all commits
cceb8a7File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a table is nested in a blockquote, the blockquote pass runs first and prefixes the still-HTML table as a single line; this later replacement inserts a multiline pipe table while leaving
>only on its first row. The separator and body rows therefore escape the quote and Goldmark cannot parse the result as the nested table that produced the HTML, so CLI/TUI display no longer renders the promised best-effort grid. Convert the table within the blockquote before splitting and prefixing its lines.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a simple table originates from valid GFM such as
[docs](https://example.com "API docs"),MarkdownToHTMLstores the title on the anchor, but this replacement reconstructs only its label and destination. Opening and saving the table unchanged therefore permanently removes the link title; include the optional title when emitting the Markdown link or classify such anchors as complex.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a simple cell contains literal Markdown punctuation, such as HTML produced from the valid GFM input
\*literal\*, this pass emits*literal*because it escapes only backslashes and pipes. Opening and saving the table unchanged therefore converts the literal asterisks into emphasis; angle-bracket text can similarly become raw HTML. Escape Markdown metacharacters in text nodes while preserving the Markdown deliberately generated for inline elements.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a simple table containing an inline code span with repeated whitespace, such as
<code>a b</code>, this collapses the code content toa b. GFM code spans preserve interior repeated spaces, so an unchanged TUI edit permanently changes the code value; normalize line endings as required for code spans, but do not collapse all whitespace runs.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a simple table contains a code span with a literal backtick, such as HTML generated from
``a`b``, this always re-emits the cell as`a`b`, so Goldmark closes the span at the embedded backtick. Opening and saving the table unchanged therefore changes the code contents and markup; select a delimiter longer than the longest backtick run and apply the required padding.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A simple table is incorrectly blocked from all TUI edit paths whenever ordinary cell text contains
colspan=orrowspan=—for example,<td>Set colspan=2 in the template</td>matches this unscoped regex even though no cell is merged. Limit the check to attributes on openingth/tdtags so textual mentions of these attribute names do not force users to edit the content on the web.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new paragraph/line checks still let a cell such as
<td><div>one</div><div>two</div></td>through becausedivis absent from this pattern, even though it is recognized as safe rich-text HTML elsewhere.cellMarkdownthen replaces both tags with spaces, and an unchanged edit resubmitsone two, permanently losing the block boundary; classify these block containers as complex or preserve their boundaries.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A valid table such as
<thead><tr><th>A</th></tr><tr><th>B</th></tr></thead>passes this complexity scan, butconvertTableHTMLpromotes only the first row to the GFM header. Saving an unchanged edit consequently recreates the second row with<td>cells in<tbody>, permanently losing its header semantics; detect additional header rows (or any laterthcells) and keep these tables on the complex-table path.Useful? React with 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.