WordWrap does not wrap escaped text properly
package main
import (
"fmt"
"gitlab.com/tslocum/cview"
)
func main() {
lines := cview.WordWrap(cview.Escape("In [Chinese astronomy], the stars that correspond to Gemini are located in two areas: the [White Tiger of the West] (西方白虎, *Xī Fāng Bái Hǔ*) and the [Vermillion Bird of the South] (南方朱雀, *Nán Fāng Zhū Què*)."), 100)
for i := range lines {
fmt.Println(lines[i])
}
}
The above code results in the following:
In [Chinese astronomy[], the stars that correspond to Gemini are located in two areas: the [White
Tiger of the West]
(西方白虎, *Xī Fāng Bái Hǔ*) and the [Vermillion Bird of the South[] (南方朱雀, *Nán Fāng Zhū Què*).
The expected result is:
In [Chinese astronomy[], the stars that correspond to Gemini are located in two areas: the [White
Tiger of the West[] (西方白虎, *Xī Fāng Bái Hǔ*) and the [Vermillion Bird of the South[] (南方朱雀, *Nán
Fāng Zhū Què*).
Edited by Trevor Slocum