-
Notifications
You must be signed in to change notification settings - Fork 49
misc fixups #59
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
base: master
Are you sure you want to change the base?
misc fixups #59
Conversation
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@devlux76 Thanks for your PR! Let me check. |
@radekrepo Can you please review? I'm dealing with influenza now and don't have a power for it. |
Hi Grigorij,
I will do my best by tomorrow morning.
Radek
śr., 19 lut 2025 o 19:55 Grigorij Dudnik ***@***.***>
napisał(a):
… @radekrepo <https://github.com/radekrepo> Can you please review? I'm
dealing with influenza now and don't have a power for it.
—
Reply to this email directly, view it on GitHub
<#59 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXOCTSFU3IDKXDRR7AJK6D2QTOTJAVCNFSM6AAAAABXMNITGGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZGYZDKNRWGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: Grigorij-Dudnik]*Grigorij-Dudnik* left a comment
(Grigorij-Dudnik/Clean-Coder-AI#59)
<#59 (comment)>
@radekrepo <https://github.com/radekrepo> Can you please review? I'm
dealing with influenza now and don't have a power for it.
—
Reply to this email directly, view it on GitHub
<#59 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXOCTSFU3IDKXDRR7AJK6D2QTOTJAVCNFSM6AAAAABXMNITGGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZGYZDKNRWGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
script = re.search(r'<script[^>]*>(.*?)</script>', content, re.DOTALL).group(1) | ||
except AttributeError: | ||
return "Script part has no valid open/closing tags." | ||
script = bleach.clean(content, tags=[], strip=True) |
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 have checked that bleach.clean() returns modified content without throwing an error also when tags are incorrectly formatted, unlike the previous version of this script.
If this is the intention of using bleach.clean(), then all good. Otherwise, it may be hard to interpret for user the behaviour of the script.
Examples of html work with bleach.clean() without throwing an error:
html = """<p >This <a href="book"> book </a attr="test"> will help you</p >"""
html = """<p >This <a href="book"> book </a attr="test"> will help you< >"""
note the missing closing of "/p" in the second object
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.
The old version of code threw an AttributeError on both example objects. It may be a bit too sensitive because the upper example looks like it has all of the opening & closing tags. It was only missing correctly formatted <script>
and </script>
tags.
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 may misunderstand the importance of the "script" tag.
@devlux76 Part of your PR with dependabot I think is very good one and let's proceed with it. What about the changes in vue linter, bleach.clean() not finds content of <script> part of vue file as intended. It just provides on output entire vue file without html tags - styles and texts inside of template part are still left there. |
Hey @devlux76, can you please remove changes related to bleach and syntax checkers, but leave dependabot changes? We'll be happy to merge it. |
I sync'd with your repo and dependabot and QC bot pointed out some things you may have missed including a faulty regex. I felt the regex one was worthy of notice
Enjoy!