Skip to content

fix: hard-truncate when smart_truncate separator is empty#186

Open
santhreal wants to merge 1 commit into
un33k:masterfrom
santhreal:fix/smart-truncate-empty-sep-v2
Open

fix: hard-truncate when smart_truncate separator is empty#186
santhreal wants to merge 1 commit into
un33k:masterfrom
santhreal:fix/smart-truncate-empty-sep-v2

Conversation

@santhreal

Copy link
Copy Markdown

smart_truncate hits ValueError when word_boundary=True separator=''. This PR fixes the regression with a focused test covering the case.

word_boundary truncation splits on separator; an empty separator is
invalid for str.split and should hard-truncate instead.
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.

1 participant