Skip to content

Markdown reader: allow grid tables to be indented#11671

Merged
jgm merged 1 commit into
jgm:mainfrom
jolars:grid-table-indentation
May 27, 2026
Merged

Markdown reader: allow grid tables to be indented#11671
jgm merged 1 commit into
jgm:mainfrom
jolars:grid-table-indentation

Conversation

@jolars
Copy link
Copy Markdown
Contributor

@jolars jolars commented May 27, 2026

Like the other table syntaxes (pipe, simple, and multiline tables) and block-level constructs generally, a grid table may now be indented by up to three spaces and still be recognized as a table. Previously the grid-table parser required the table to begin at the left margin, so an indented grid table was parsed as a paragraph.

The leading indentation is stripped uniformly from each line before the table is parsed, so an indented grid table produces the same AST as its non-indented equivalent.

Adds a command test.

Like the other table syntaxes (pipe, simple, and multiline tables) and
block-level constructs generally, a grid table may now be indented by up
to three spaces and still be recognized as a table.  Previously the
grid-table parser required the table to begin at the left margin, so an
indented grid table was parsed as a paragraph.

The leading indentation is stripped uniformly from each line before the
table is parsed, so an indented grid table produces the same AST as its
non-indented equivalent.

Adds a command test.
@jgm jgm merged commit 41f829c into jgm:main May 27, 2026
7 of 10 checks passed
@jgm
Copy link
Copy Markdown
Owner

jgm commented May 27, 2026

Thanks! I don't love parseFromString, but there seems to be no good alternative since the parsing is done in an external library.

smc181002 pushed a commit to smc181002/pandoc that referenced this pull request May 29, 2026
Like the other table syntaxes (pipe, simple, and multiline tables) and
block-level constructs generally, a grid table may now be indented by up
to three spaces and still be recognized as a table.  Previously the
grid-table parser required the table to begin at the left margin, so an
indented grid table was parsed as a paragraph.

The leading indentation is stripped uniformly from each line before the
table is parsed, so an indented grid table produces the same AST as its
non-indented equivalent.

Adds a command test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants