-
Notifications
You must be signed in to change notification settings - Fork 50
In Firefox, the code from the documentation is copied with Non-breaking spaces (nbsp) #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I cannot reproduce this with Firefox 106 on Windows (I get spaces after copy&paste). Can anybody else reproduce this issue? |
Hm. To clarify: I use mac OS 11.6.8 and Firefox 107.0b7 I also checked the stable version 106 -- everything is fine there, and 108.0a1 here the bug is reproduced. Maybe this is a beta version problem, but a new release is coming soon and it looks like it will get into the stable version. |
Ah, yeah. https://bugzilla.mozilla.org/show_bug.cgi?id=359303#c145 mentions 4 cases, and the last two have been moved into https://bugzilla.mozilla.org/show_bug.cgi?id=1769534, and that fix targets Firefox 107. I think we should follow suite and get rid of the non-breaking spaces, and instead prevent space-folding by using |
Agreed. I'm a Firefox user as well and encountered this issue yesterday.
Should the discussion be moved to PhD doc or continue here? I'm seeing no one here has been assigned to this issue. |
"Here" is phd. |
I see. Didn't realize "phd" is the same as "PhD doc". |
Some browsers (notably Firefox ≥ 107) copy these NBSPs verbatim, what causes issues when pasting into text editors/IDE. Since these NBSPs are generated by `highlight_string()` and there is no option to produce regular spaces instead, we replace them manually. To preserve the desired code layout, this requires something like <php/web-php#744>.
Given that this is an open-source project, you could have submitted a pull request. :) |
I see. Didn't know this issue can be solved that way. Besides, submitting a pull request is current beyond my ability. Actually, I practiced and learned that many years ago by using GitHub Desktop but have long since forgotten the steps. But thanks for letting me know a solution. |
Some browsers (notably Firefox ≥ 107) copy these NBSPs verbatim, what causes issues when pasting into text editors/IDE. Since these NBSPs are generated by `highlight_string()` and there is no option to produce regular spaces instead, we replace them manually. To preserve the desired code layout, this requires something like <php/web-php#744>. Closes GH-72.
Starting with Firefox 103, it now does not replace nbsp with a normal space. https://bugzilla.mozilla.org/show_bug.cgi?id=359303
Try copying some code from the documentation and pasting it into a text file. (for example from here https://www.php.net/manual/en/function.preg-replace.php)
The text was updated successfully, but these errors were encountered: