-
Notifications
You must be signed in to change notification settings - Fork 318
Allow Detection of WWW Autolinks #406
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: 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.
Very nice, thanks for working on this!
I've left some comments in the PR for you to address, but overall great work.
|
||
if (linkTypes.length == 0) { | ||
throw new IllegalArgumentException("linkTypes must not be empty"); | ||
} |
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.
No need to duplicate the checks above if we're delegating to linkTypes(Set<AutolinkType> linkTypes)
anyway.
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.
Removed the second check. The first check was just to provide a more explicit error message than whatever is thrown by calling Set.of(null)
, but I can remove if we think that's unnecessary.
...k-ext-autolink/src/main/java/org/commonmark/ext/autolink/internal/AutolinkPostProcessor.java
Outdated
Show resolved
Hide resolved
...k-ext-autolink/src/main/java/org/commonmark/ext/autolink/internal/AutolinkPostProcessor.java
Outdated
Show resolved
Hide resolved
...k-ext-autolink/src/main/java/org/commonmark/ext/autolink/internal/AutolinkPostProcessor.java
Outdated
Show resolved
Hide resolved
...k-ext-autolink/src/main/java/org/commonmark/ext/autolink/internal/AutolinkPostProcessor.java
Show resolved
Hide resolved
Thanks for the reviews! I think all comments should be addressed now. |
Implements #298. Would be nice to have this additional functionality, so took a stab at a PR for this.
Can add a changelog entry if the current approach looks good.