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

perf(external_link): update regexp #4467

Merged
merged 1 commit into from Aug 8, 2020

Conversation

SukkaW
Copy link
Member

@SukkaW SukkaW commented Aug 8, 2020

What does it do?

isExternalLink() has a shorthand optimization for absolute link:

https://github.com/hexojs/hexo-util/blob/fe64888f28acaa77f26eab04e7d358c6e6029967/lib/is_external_link.js#L19

Then I think why can't we exclude relative link directly in the rATag to avoid extra isExternalLink() and RegExp#test? So here is the PR.

How to test

git clone -b BRANCH https://github.com/USER/hexo.git
cd hexo
npm install
npm test

Screenshots

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@SukkaW SukkaW requested a review from a team August 8, 2020 12:20
@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.242% when pulling b4beec3 on SukkaW:external-link-regexp into ec1e39f on hexojs:master.

@SukkaW SukkaW merged commit f25deb4 into hexojs:master Aug 8, 2020
@curbengh curbengh mentioned this pull request Aug 10, 2020
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.

None yet

3 participants