Skip to content

Pad Markdown table cells by display width; raise Java baseline to 21 - #16

Merged
rpost merged 6 commits into
mainfrom
markdown-table-display-width
Oct 15, 2026
Merged

rpost merged 6 commits into
mainfrom
markdown-table-display-width

Conversation

@bwaldvogel

Copy link
Copy Markdown
Contributor

MarkdownTable padded cells by String.length(). Wide characters (CJK, emoji such as ✅/❌)
take two columns in a monospace font, so the column borders of rows containing them were
shifted. Cells containing | or line breaks broke the table entirely.

  • Pad cells by display width: East Asian wide characters and emoji count as two columns,
    combining marks and format characters (e.g. zero width joiner) as none
  • Escape | as \| and line breaks as <br>
  • The first commit adds tests whose validation files show the broken output, so the fix
    commit shows the difference directly

The display width relies on Character.isEmojiPresentation, which needs Java 21.
Therefore:

  • Raise the Java baseline from 17 to 21; CI runs the tests on Java 21, 25 and 27
  • Update all dependencies (including JUnit 6 for the tests; the extension is still compiled
    against the JUnit 5 API), Gradle 9.8.1 and the GitHub Actions

@bwaldvogel
bwaldvogel force-pushed the markdown-table-display-width branch from 1012de1 to b355dd3 Compare October 15, 2026 08:32
@bwaldvogel
bwaldvogel requested a review from rpost October 15, 2026 08:37

@rpost rpost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!

@rpost
rpost merged commit f748203 into main Oct 15, 2026
4 checks passed
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