Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 109 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ clap = { version = "4", features = ["derive"] }
regex = "1"
html5ever = "0.27"
markup5ever_rcdom = "0.3"
textwrap = "^0.16"
unicode-width = ">=0.1, <0.2"


[dev-dependencies]
Expand Down
9 changes: 9 additions & 0 deletions docs/unicode-width.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Unicode Width Handling

`mdtablefix` wraps paragraphs and list items while respecting the display width of
Unicode characters. The `unicode-width` crate is used to compute the width of
strings when deciding where to break lines. This prevents emojis or other
multi-byte characters from causing unexpected wraps or truncation.

Whenever wrapping logic examines the length of a token, it relies on
`UnicodeWidthStr::width` to measure visible columns rather than byte length.
Loading