retext-project / retext

ReText: Simple but powerful editor for Markdown and reStructuredText
GNU General Public License v2.0
1.89k stars 196 forks source link

Non Breaking space not taken in account #249

Open YannKervran opened 7 years ago

YannKervran commented 7 years ago

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

mitya57 commented 7 years ago

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.

YannKervran commented 7 years ago

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.

mitya57 commented 7 years ago

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?

YannKervran commented 7 years ago

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 ?

mitya57 commented 7 years ago

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.

YannKervran commented 7 years ago

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

mitya57 commented 7 years ago

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?

YannKervran commented 7 years ago

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

mitya57 commented 7 years ago

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

YannKervran commented 7 years ago

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 commented 7 years ago

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. ☺