termui
termui copied to clipboard
How to use `[` and `]` characters in cells ?
style_parser.go
implements a special feature where [
and ]
characters are used to separate styled text.
https://github.com/gizak/termui/blob/f976fe697aa09b747f16fa6e08c36dde5fb16f27/style_parser.go#L19-L20
https://github.com/gizak/termui/blob/f976fe697aa09b747f16fa6e08c36dde5fb16f27/style_parser.go#L105-L112
Which ends up cropping the text:
Is there a way to disable this feature without having to edit the code ?
+1 for this. Maybe we should make \[
escape the significance of the [ character.
Ok I finally have a solution! Made a PR https://github.com/gizak/termui/pull/321 and there is no need to \
to escape. I made the logic look for ]( i.e. you have to have a ( to start the style after the ending ] or it will ignore [ and ].