-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-129873: IDLE: Improve help.py's method of parsing HTML #129859
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
Conversation
copy_strip now only copies content between certain tags. This commit also cleans up old logic for dealing with the undesired content. Added note to idle.rst about updating help.html
This will be failing until the updated html is added. However since #129727 updates the .rst and already has changes to the html it is best to wait till that is merged and then I will update it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete the definition of self.show on line 57
PR 129727 is merged, so add the new help.html.
I have made the requested changes; please review again |
Thanks for making the requested changes! @terryjreedy: please review the changes made to this pull request. |
Added during testing and forgot to remove.
Added during testing and forgot to remove. Also remove self.show def
I forgot we are working with html and indentation does not matter here. |
I forgot indentation is added after :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am slightly surprised that the trailing newline (the double \n\n
) at the end of the file did not trigger an error like trailing spaces. (This at least used to be an error for some other files.) Leave it until the rules change.
EDIT: I prefer the .html with the strange random indent removed.
Otherwise, looks correct. Will download, manually test, make an issue, add news, upload, and presumably merge.
Thanks @StanFromIreland for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…onGH-129859) In `help.copy_strip`, only copy the text `<section>`. In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html. Add a reminder at the top of idle.rst to run copy_strip after changes. --------- (cherry picked from commit 6fbf15f) Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Terry Jan Reedy <[email protected]>
GH-129884 is a backport of this pull request to the 3.13 branch. |
…onGH-129859) In `help.copy_strip`, only copy the text `<section>`. In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html. Add a reminder at the top of idle.rst to run copy_strip after changes. --------- (cherry picked from commit 6fbf15f) Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Terry Jan Reedy <[email protected]>
GH-129885 is a backport of this pull request to the 3.12 branch. |
Let me know in the future if they are needed and I can do it for you. |
…129859) (#129884) gh-129873: IDLE: Improve help.py's method of parsing HTML (GH-129859) In `help.copy_strip`, only copy the text `<section>`. In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html. Add a reminder at the top of idle.rst to run copy_strip after changes. --------- (cherry picked from commit 6fbf15f) Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Terry Jan Reedy <[email protected]>
…129859) (#129885) gh-129873: IDLE: Improve help.py's method of parsing HTML (GH-129859) In `help.copy_strip`, only copy the text `<section>`. In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html. Add a reminder at the top of idle.rst to run copy_strip after changes. --------- (cherry picked from commit 6fbf15f) Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: Terry Jan Reedy <[email protected]>
They? Nearly everying is backported. |
I meant "make an issue, add news". |
In
help.copy_strip
, only copy the text<section>
. Inhelp.HelpParser.handle_starttag
and elsewhere, remove code to skip the no longer present html. Add a reminder at the top of idle.rst to run copy_strip after changes.As discussed with Terry, copy_strip() now only copies desired content instead of skipping lines while parsing.
📚 Documentation preview 📚: https://cpython-previews--129859.org.readthedocs.build/