Markdown table separators: don't add surrounding spaces
Open
Nobody has claimed this yet.
lang:markdown
status:needs discussion
- Dominant language
- JavaScript
- Stars
- 52.3k
- Forks
- 5k
- Avg merge
- 19h 2m
- Merged PRs (30d)
- 117
Description
Prettier 3.4.2
Playground link
Input:
| type parameter | meaning |
|:--------------:|---------|
| E | Element |
Output:
| type parameter | meaning |
| :------------: | ------- |
| E | Element |
Expected output:
| type parameter | meaning |
|:--------------:|---------|
| E | Element |
Why?
- This could make Prettier compatible with Djot tables that don't accept surrounding spaces.
- From an ASCII art pov, surrounding spaces break the separators. This is incorrectly rendereed by ASCII-to-diagram converters.
- IMO, this looks better without the surrounding spaces, especially with alignment markers
:.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Prettier Playground example and reproduce the Markdown table input shown in the issue. Compare the current output with the expected output; done means aligned separator rows retain no spaces around their colon markers while the table remains correctly formatted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, markdown
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100