Fix table markup alignment#224
Merged
ericdallo merged 3 commits intoeditor-code-assistant:masterfrom Apr 17, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix table column alignment with bold/italic markup
When
markdown-hide-markupis enabled, bold and italic delimiters (**,*) arehidden from display but
markdown-table-alignpads cells based on raw characterwidth including those delimiters. This causes columns with markup to appear narrower
than intended:
**text**): 4 chars too narrow*text*): 2 chars too narrowExample
Fix
After
markdown-table-alignpads each table, a new functioneca-table--compensate-hidden-markupscans each cell for*/**delimiterpairs via regex and adds an overlay with an
after-stringof compensatingspaces:
Key details:
eca-table-markup-padproperty (not
eca-table-overlay) soeca-table-remove-overlaysin the beautifystep does not wipe them
when
evaporateis seteca-table--max-line-widthupdated to subtract hidden markup for accuratewide-table detection
Files changed
eca-table.el— addedeca-table--count-markup-chars,eca-table--compensate-hidden-markup; updatedeca-table-alignandeca-table--max-line-widthtest/eca-table-markup-test.el— interactive visual test (M-x eca-table-markup-test)Notes
Code and PR description with help from Claude. In addition to the test code included, I have tested with many other tables.
and programmatic checks (
M-x eca-table-markup-test-run-checks)