Open yuvallanger opened 8 years ago
@yuvallanger Please provide some sample input which contains those codes, so I can try to debug it.
Thanks
Using the pybuffer script, which opens a Python interpreter inside of WeeChat, I've generated the following string:
>>> "regular text\n{red}red text{regular}\n{green}green text{regular}\n{blue}blue
text{regular}\nregular text again".format(regular=weechat.color('chat'),
red=weechat.color('red'), green=weechat.color('green'), blue=weechat.color('blue'))
'regular text\n\x19F03red text\x1901\n\x19F05green text\x1901\n\x19F09blue
text\x1901\nregular text again'
Many thanks!
Hmm, those chars are BN
Looks like it's removed in X9 stage of the algorithm:
Remove all RLE, LRE, RLO, LRO, PDF, and BN characters.
It says that removal is optional, and one can implement without it. It looks more complicated, don't know when I can get around to implementing it.
I am trying to use your library to replace the older pyfribidi library in the weechat script found in https://github.com/yuvallanger/weechat-biditext/ which is a fork of https://github.com/spacepluk/weechat-biditext/
When I use
bidi.algorithm.get_display(line)
on a line of weechat's buffer, IRC colour codes are stripped out. Is it possible to keep them?python-bidi==0.4.0 and python 2.7.6