Pasting HTML Table with Mixed <th> and <td> Drops Columns
#185076
Replies: 4 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Hi @ssigwart, thanks for being a part of the GitHub Community! Can you share a screen recording? I was unable to replicate the issue as the HTML did not get changed to markdown on my end. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, @ebndev. Thanks for the quick response. Here's a screen recording. I typed Cmd+C to copy after highlighting. I'm not sure if it matters, but I'm on MacOS. Screen.Recording.2026-01-23.at.11.03.38.PM.mov |
Beta Was this translation helpful? Give feedback.
-
|
This appears to be a bug in GitHub's HTML-to-Markdown table converter. The issue occurs when a table has mixed What's happeningWhen you paste the HTML table, GitHub's conversion pipeline is incorrectly calculating the column count. Instead of preserving all three columns (Col A, Col B, Col C), it's dropping the first column and only outputting two columns in the generated Markdown. The resulting Markdown shows: Notice that the Root causeThe HTML-to-Markdown converter appears to assume that:
When this assumption is violated (rows with mixed cell types), the converter miscounts columns and drops data during conversion. Expected behaviorGitHub should convert the table to: This preserves all data regardless of whether cells are marked as WorkaroundUntil this is fixed, you can normalize the HTML before pasting by converting all |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Feature Area
Issues
Body
When copying an HTML that that has both
<th>and<td>in the same<tr>, the<th>column is dropped. And example is below.Steps to Reproduce
It winds up pasting this:
Markdown
Rendered
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions