Skip to content

URI handling#89

Merged
endaaman merged 4 commits intoendaaman:masterfrom
iTakeshi:uri-handling
Jan 18, 2023
Merged

URI handling#89
endaaman merged 4 commits intoendaaman:masterfrom
iTakeshi:uri-handling

Conversation

@iTakeshi
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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