Skip to content
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

isso: html.py: Prevent auto creation of invalid links in comments #995

Merged
merged 3 commits into from
Mar 10, 2024

Conversation

pkvach
Copy link
Contributor

@pkvach pkvach commented Mar 3, 2024

Checklist

  • All new and existing tests are passing
  • I have added an entry to CHANGES.rst because this is a user-facing change or an important bugfix
  • I have written proper commit message(s)

What changes does this Pull Request introduce?

  • Enhanced the Sanitizer class in isso/utils/html.py to prevent the automatic creation of invalid links by:
    modifying the set_links function to reject new links, allowing only existing links to be modified. This change addresses the issue where text could be misinterpreted as a domain name, leading to the creation of invalid links.

  • Updated tests in isso/tests/test_html.py to include new cases that ensure:
    text that could be misinterpreted as links, such as 'ld.so' and file paths, are not automatically converted into links.

Why is this necessary?

Fixes #557

Copy link
Member

@jelmer jelmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the linting issues. LGTM otherwise.

@jelmer
Copy link
Member

jelmer commented Mar 10, 2024

also, please complete the checklist in the PR template

@pkvach pkvach changed the title isso: html.py: Prevent auto creation of invalid links isso: html.py: Prevent auto creation of invalid links in comments Mar 10, 2024
@pkvach
Copy link
Contributor Author

pkvach commented Mar 10, 2024

Added an entry to CHANGES.rst

@pkvach
Copy link
Contributor Author

pkvach commented Mar 10, 2024

Fixed linting issues.

@jelmer jelmer merged commit 90aa041 into isso-comments:master Mar 10, 2024
11 checks passed
@pkvach pkvach deleted the fix/prevent-links-auto-creation branch March 11, 2024 05:34
@ix5
Copy link
Member

ix5 commented Apr 13, 2024

Sorry for the late reply, thank you @pkvach for this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

disabling autolink doesn't work
3 participants