commonmark / commonmark/commonmark-java

How to preserve spaces in GFM tables?

Open
#443 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
2.7k
Forks
336
PR merge metrics
No merged PRs in 30d

Description

Hello,
in my project there are many table of the form

| A |B|
|---|-|
| 1 |2|

When I use the GFM table extension they are correctly parsed, but all spaces are removed and that make editing the table impossible afterwards. Is there a way to prevent this condensation of the existing spaces?

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the GFM table extension and trace how table cells are parsed and rendered, focusing on where surrounding spaces are condensed. Check the existing table-related tests to determine whether whitespace preservation is supported; done means either identifying the available option or defining and testing the requested behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.