retext icon indicating copy to clipboard operation
retext copied to clipboard

Non Breaking space not taken in account

Open YannKervran opened this issue 8 years ago • 11 comments
trafficstars

Hello, I have seen that ReText doesn't save the NBSP written with Unicode character as actual NBSP but as a normal space. So we loose all the u+00A0 characters I have included in a markdown file when I reopen it. All the best

YannKervran avatar Jan 04 '17 10:01 YannKervran

This is fixed in the latest commit (83019dbaf1954ec3). However that commit breaks the CI tests, so I am not yet sure it is the right fix. If you could test it, that would be nice.

mitya57 avatar Jan 04 '17 12:01 mitya57

I have seen no difference : the u+00A0 character is not taken in account in preview nor saved in the file. I tried the retext-6.0 branch also, just in case.

YannKervran avatar Jan 11 '17 12:01 YannKervran

Hm, no, in master this bug should be fixed. There is even an auto test that makes sure U+00A0 is preserved (and with fixed PyQt that test passes on Travis too). In retext-6.0 it is not fixed.

Which OS are you using? How did you try the master version?

mitya57 avatar Jan 11 '17 13:01 mitya57

I am under Debian Sid. I got the Master via a standard git pull command. Does this fix is based upon a specific version of Python ?

YannKervran avatar Jan 17 '17 10:01 YannKervran

Can you try running the testsuite to see if it passes on your system? Please run python3 setup.py test in a directory where you cloned ReText.

mitya57 avatar Jan 22 '17 13:01 mitya57

Here are the resulting lines of the test : http://pastebin.com/L1YaPbSp Let me know if you want to make other tests

YannKervran avatar Jan 25 '17 07:01 YannKervran

Sorry for the delayed response again. The test passes, so at least some NBSP are converted properly. Can you please attach an example Markdown file (that contains NBSPs) where ReText ignores the NBSPs?

mitya57 avatar Feb 11 '17 14:02 mitya57

Hi, sorry for the delay too. So many things to do. Here is a sample. I have nbsp space(0xC2A0) before some punctuation symbols, and if I open it with Retext and save it again, they disappear.

test.txt

YannKervran avatar Mar 03 '17 12:03 YannKervran

I cannot reproduce this by just opening and saving. However I can reproduce it by cutting the text, pasting it again and then saving.

mitya57 avatar Mar 03 '17 13:03 mitya57

HI there :) It seems that everything is fixed now. I can see the NBSP in my files being preserved now. Great job ! I have to find how to type them in directly in ReText now 👍

YannKervran avatar Oct 11 '17 14:10 YannKervran

Just to be precise : the preview still doesn't take in account the NBSP if I don't put them with the nbsp symbolfrom the rollup menu but the 0xC2A0 symbol is correctly saved, which is the most important for me. ☺

YannKervran avatar Oct 11 '17 15:10 YannKervran