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

URI handling #89

Merged
merged 4 commits into from
Jan 18, 2023
Merged

URI handling #89

merged 4 commits into from
Jan 18, 2023

Conversation

iTakeshi
Copy link
Contributor

@iTakeshi iTakeshi commented Jan 3, 2023

Fixes #46

Parentheses in URI

  • ( and ) in a URI should be paired, otherwise they are removed from the match. This fixes the markdown link problem like [link](https://example.com) --- which is previously matched as https://example.com) but now it's correctly matched as https://example.com.
  • On the other hand, matched parentheses in a URI can be detected, like https://en.wikipedia.org/wiki/WWW_(disambiguation).
  • NOTE: This regex cannot detect nested parentheses. IMO it's acceptable for daily normal usecases.

Trailing periods/commas in URI

  • In a sentence like Refer to the doc: https://doc.example.com/index.html., the regex detect the URI as https://doc.example.com/index.html. with the trailing period, leading us to the 404 page.
  • I couldn't find a sophisticated way to detect/remove such trailing periods (note: lookaround is not what we want here) thus I wrote a small snippet to remove periods and commas in C code.

@endaaman
Copy link
Owner

endaaman commented Jan 11, 2023

@iTakeshi
CI somehow failed and I updated CI rules (upgrading to 22.04 from 20.04), so can you rebase PR branch and force-push?

@iTakeshi
Copy link
Contributor Author

iTakeshi commented Jan 17, 2023

Sorry for my late response. I've force pushed the branch but there still remains an error which reads "Could not find a usable config.yml, you may have revoked the CircleCI OAuth app. Please sign out of CircleCI and log back in with your VCS before triggering a new pipeline."
Is this a problem on my side, or can you fix it?

@endaaman
Copy link
Owner

Sorry, this is my matter and I revoked and reauthorized third-patry app, then it has been fixed maybe.
Anyway, this PR is tested on my local machine and it's OK. merge.

@endaaman endaaman merged commit ba4d935 into endaaman:master Jan 18, 2023
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.

Improve URL regex
2 participants