Skip to content

[JEWEL-1256] Fix incremental Markdown parsing for table rows#3428

Closed
AlexVanGogen wants to merge 1 commit into
JetBrains:masterfrom
AlexVanGogen:alexvangogen/JEWEL-1256-new-table-rows
Closed

[JEWEL-1256] Fix incremental Markdown parsing for table rows#3428
AlexVanGogen wants to merge 1 commit into
JetBrains:masterfrom
AlexVanGogen:alexvangogen/JEWEL-1256-new-table-rows

Conversation

@AlexVanGogen
Copy link
Copy Markdown
Contributor

@AlexVanGogen AlexVanGogen commented Feb 18, 2026

Description

When typing in the Markdown editor, a line starting with | immediately after a table header was initially parsed as a paragraph. As the user continued typing (e.g., | A | B |), the line should become a table row, but incremental parsing didn't re-evaluate the preceding table block, causing the row to remain a separate paragraph.

This change introduces allowsMergingWithNextBlock property to MarkdownBlockProcessorExtension, allowing extensions to indicate that they can absorb subsequent blocks during re-parsing. The MarkdownProcessor now checks this property and includes the preceding block in the re-parse range when appropriate.

Examples

Before

Screen.Recording.2026-02-13.at.13.28.03.mov

After

Screen.Recording.2026-02-18.at.15.38.20.mov

Release notes

Bug fixes

  • JEWEL-1256 Fix incremental parsing for manually typed table rows in editor mode

Note

Medium Risk
Changes incremental parsing boundaries in MarkdownProcessor and extends the experimental MarkdownBlockProcessorExtension API, which could affect editor-preview parsing behavior for other custom blocks if misconfigured.

Overview
Fixes editor-mode incremental Markdown parsing so blocks like GFM tables can absorb a following paragraph when edits turn it into a table row.

This introduces MarkdownBlockProcessorExtension.allowsMergingWithNextBlock (default false) and updates MarkdownProcessor to include the preceding custom block in the reparse range when that flag is enabled.

Enables the flag for the GFM tables processor and adds a dedicated gfmTables.tests module plus JUnit tests covering the table-header-to-row incremental typing scenarios.

Written by Cursor Bugbot for commit 4d86eb4. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown
Collaborator

@rock3r rock3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rock3r
Copy link
Copy Markdown
Collaborator

rock3r commented Mar 18, 2026

@AlexVanGogen solve conflicts then we can merge :)

@AlexVanGogen AlexVanGogen force-pushed the alexvangogen/JEWEL-1256-new-table-rows branch from 91038b8 to ac62b0a Compare March 25, 2026 16:42
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread platform/jewel/markdown/test-table-overflow.md Outdated
@AlexVanGogen AlexVanGogen force-pushed the alexvangogen/JEWEL-1256-new-table-rows branch from ac62b0a to 4d86eb4 Compare March 25, 2026 16:55
@AlexVanGogen AlexVanGogen force-pushed the alexvangogen/JEWEL-1256-new-table-rows branch from 4d86eb4 to 48c6b7f Compare May 6, 2026 13:01
…ter table header

When typing in the Markdown editor, a line starting with `|` immediately
after a table header was initially parsed as a paragraph. As the user
continued typing (e.g., `| A | B |`), the line should become a table row,
but incremental parsing didn't re-evaluate the preceding table block,
causing the row to remain a separate paragraph.

This change introduces `allowsMergingWithNextBlock` property to
`MarkdownBlockProcessorExtension`, allowing extensions to indicate that
they can absorb subsequent blocks during re-parsing. The `MarkdownProcessor`
now checks this property and includes the preceding block in the re-parse
range when appropriate.
@AlexVanGogen AlexVanGogen force-pushed the alexvangogen/JEWEL-1256-new-table-rows branch from 48c6b7f to 2fd51ca Compare May 6, 2026 13:42
@rock3r
Copy link
Copy Markdown
Collaborator

rock3r commented May 7, 2026

Ready to merge

intellij-monorepo-bot pushed a commit that referenced this pull request May 11, 2026
…ter table header

When typing in the Markdown editor, a line starting with `|` immediately
after a table header was initially parsed as a paragraph. As the user
continued typing (e.g., `| A | B |`), the line should become a table row,
but incremental parsing didn't re-evaluate the preceding table block,
causing the row to remain a separate paragraph.

This change introduces `allowsMergingWithNextBlock` property to
`MarkdownBlockProcessorExtension`, allowing extensions to indicate that
they can absorb subsequent blocks during re-parsing. The `MarkdownProcessor`
now checks this property and includes the preceding block in the re-parse
range when appropriate.

closes #3428

GitOrigin-RevId: 7601f504870a216af4e0eb7e7cb031b48d7302ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants