Right now, the code supports \~ for non-breaking space, but the RTF spec (1.9.1) lists a couple of other special characters that could be easily supported in the same way:
In particular, it seems that \- (optional hyphen) should map to U+00AD (soft hyphen), and \_ (non-breaking hyphen) should map to U+2011 (non-breaking hyphen).
Right now, the code supports
\~
for non-breaking space, but the RTF spec (1.9.1) lists a couple of other special characters that could be easily supported in the same way:In particular, it seems that
\-
(optional hyphen) should map to U+00AD (soft hyphen), and\_
(non-breaking hyphen) should map to U+2011 (non-breaking hyphen).For example, https://github.com/joshy/striprtf/blob/751f8eda03afb034039759921af61fa811aca140/striprtf/striprtf.py#L155-L168 could be simplified to something like:
and then just add all the other cases as additional entries in
specialchars
.