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
Support whitelisting subdomains. #48
Conversation
@@ -293,6 +292,25 @@ def delinkify(text, allow_domains=None, allow_relative=False): | |||
return _render(forest) | |||
|
|||
|
|||
def _domain_match(test, compare): |
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 know, naming is hard, but not idea which one of test or compare is the user data, and which one is developer-defined. Or if it even matters?
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.
Fair enough.
('an.ex.am.pl', 'an.*.am.pl', True), | ||
('a.ex.am.pl', 'an.*.am.pl', False), | ||
('ex.am.pl', 'an.*.am.pl', False), | ||
('an.ex.am.p.le', 'an.**.p.le', 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.
Can't decide if this should pass or not. Tempted to either decide not to support **
, or not allow anything in front of 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.
I'd support:
**.p.le
but not:
an.**.p.le
I'm not sure I see the use case there.
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.
Yeah, I agree with that, but how to "not support" it? I'd like it to fail loudly. Throw ValueError
or something?
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.
yeah, throw an error
No description provided.