-
Notifications
You must be signed in to change notification settings - Fork 10
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
Allow relative urls #47
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for providing this! I think the PR is breaking existing behaviors in its current state, so we may need to fix that in order to be able to proceed and merge it. I also think that we should add new unit tests to verify the that tag is working as expected for relative URLs. 🙂
rendered = '[url={}]{}[/url]'.format(href, value) if option else \ | ||
'[url]{}[/url]'.format(value) |
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.
Why remove this logic? This is going to introduce a change in behavior and I don't think this is necessary in order to allow relative URLs.
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.
¯\_(ツ)_/¯
Just felt this way.
I believe you're right, let's not change it too too much.
Updated |
Also replaced http:// with https:// because year is 2023 |
for xss in bbcode_settings.URL_XSS_FILTER: | ||
if xss in url: | ||
return url |
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.
This logic is duplicated in three places. Could we define it in a shared method to avoid the duplication (eg. in core/utils
)?
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.
On it
Fixes #45