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
IDLE menu option to convert non-ascii quotes & other? #80400
Comments
Some of my students routinely have to copy code samples from PDF documents where the regular Python acceptable ASCII quotation marks have been replaced by smart quotes. Let's add an Edit menu option to fix smart-quotes. |
Also dashes and hyphens to minuses and non-breaking spaces to normal spaces. |
Would it be worthwhile to automatically convert the text when it's being pasted or would there be a scenario where it would be desirable to keep these characters in the text? It seems the point here is that the user wouldn't even realize that the quotes (or dashes) being copied aren't the right ones and they would have to learn to take the extra step of formatting the text. That seems annoying, so maybe automatic conversion would eliminate that? For the menu option route, in the editor there is an additional 'Format' menu which has some text manipulation options, but the Shell doesn't have this menu available. There isn't any formatting options on the 'Edit' menu currently. Would it be better to add a 'Format' menu to the Shell or have this on the 'Edit' menu (which is already getting long)? For the actual text conversion, I pasted some smart quotes on Windows and it pasted as \u2018\u2018 (two single left quotations marks) and \u2019\u2019 (two single right quotation marks) instead of \u201C (double left) and \u201D (double right). \u0060 (grave accent) and \u00B4 (acute accent) also seem to be possible values that are used for quotes, although converting them automatically may be more problematic. I think for starters the idea would be: The dash may be more complicated since there are more of them. Unless the category could be used. |
I support adding a new function, with these notes.
Raymond, do users encounter all of the characters and combinations Cheryl suggested? Serhiy, do you know if real pdfs make the other changes you pointed at? Can you provide or suggest a specific test string?
I think including Format on the Shell menu, with a subset of entries active, should be a follow-up issue. Another possible follow-up is to check pasted or opened text and offer to edit if appropriate. I am wary of doing so automatically, especially to start.
|
The only recurring issue is with the smart quotes. For anything else, perhaps there can be a box on the General configuration tab for additional source/dest replacement pairs. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: