GitHunt
ZB

zbysir/textwrap

Better text wrap algorithms

Textwrap

Text wrap algorithms like css 'overflow-wrap: break-word;'

overflow-wrap: break-word

  • Wrap text without breaking words as much as possible
  • Support Chinese characters and super long words

Usage

go get github.com/zbysir/textwrap
textwrap.TextWrap("text", func(s string) bool {
		return len(s) > 10
})

Known problems

Languages

Go100.0%

Contributors

Apache License 2.0
Created February 17, 2023
Updated October 1, 2024
zbysir/textwrap | GitHunt