python-arabic-reshaper icon indicating copy to clipboard operation
python-arabic-reshaper copied to clipboard

[FR] Support ANSI color codes

Open NightMachinery opened this issue 3 years ago • 1 comments

I am using this package to be able to use my terminal in the rare cases where some RTL text is involved. I currently have this script:

#!/usr/bin/env python3

import arabic_reshaper
import sys
from bidi.algorithm import get_display

text_to_be_reshaped = sys.stdin.read()
reshaped_text = arabic_reshaper.reshape(text_to_be_reshaped)
bidi_text = get_display(reshaped_text)
print(bidi_text, end='')

And it works great: image

But it would be even more awesome if it could support ANSI color codes: image

NightMachinery avatar Mar 16 '21 15:03 NightMachinery

I am not sure this problem is by the reshaper or by the fact that get_display is called on the text, could you write a unit test that fails with this case?

mpcabd avatar Mar 23 '21 11:03 mpcabd