-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix: Tables does not rendered correctly #7465 #8096
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: main
Are you sure you want to change the base?
Conversation
All contributors have signed the CLA ✍️ ✅ |
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.
1 issue found across 1 file
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="gui/src/components/StyledMarkdownPreview/utils/remarkTables.tsx">
<violation number="1" location="gui/src/components/StyledMarkdownPreview/utils/remarkTables.tsx:171">
Clearing the tracked child positions here means subsequent tables in the same paragraph keep their raw markdown text, so a second table renders twice (once as text, once as a table). This regresses multi-table paragraphs.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
newNodes.push(...afterNodes); | ||
|
||
// Mark positions as consumed | ||
positions.length = 0; |
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.
Clearing the tracked child positions here means subsequent tables in the same paragraph keep their raw markdown text, so a second table renders twice (once as text, once as a table). This regresses multi-table paragraphs.
Prompt for AI agents
Address the following comment on gui/src/components/StyledMarkdownPreview/utils/remarkTables.tsx at line 171:
<comment>Clearing the tracked child positions here means subsequent tables in the same paragraph keep their raw markdown text, so a second table renders twice (once as text, once as a table). This regresses multi-table paragraphs.</comment>
<file context>
@@ -104,16 +129,46 @@ export function remarkTables() {
+ newNodes.push(...afterNodes);
+
+ // Mark positions as consumed
+ positions.length = 0;
} catch (e) {
console.error("Failed to parse markdown table after regex match", e);
</file context>
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.
This is intentional. All elements in positions are consumed at this stage, so the variable won’t be referenced again later. Thanks for pointing it out, though!
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.
Thanks, I've learnt: "In remarkTables, the positions array is fully consumed when constructing before/after nodes around a parsed table; it is not used later, so clearing positions.length = 0 at that point is intentional. In future reviews, verify whether a tracking array/variable is referenced later before flagging its clearing as a regression.".
Edit this learning here.
I have read the CLA Document and I hereby sign the CLA |
Issue
Fixes CON-7465: Pycharm: Tables does not rendered correctly
Changes
Files Changed
remarkTables.tsx - Remark plugin for github-flavor markdown tables
Checklist
Screen recording or screenshot
before

after

Tests
Verified extension startup and functionality in VS Code debugging on macOS 15.6.1.
I have read the CLA Document and I hereby sign the CLA
Summary by cubic
Fixes CON-7465 by restoring correct GFM table rendering in Markdown previews. Inline content (like inline code and emphasis) inside table cells is now preserved.