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

refactor(external_link): optimize regex pattern #3895

Merged
merged 1 commit into from
Dec 1, 2019

Conversation

SukkaW
Copy link
Member

@SukkaW SukkaW commented Dec 1, 2019

What does it do?

Optimize the regexp used in external_link filter. The new regexp will avoid edge cases like a prefixed tag <article>, and it is faster (benchmark shows it is 18% faster).

How to test

git clone -b external_link_regex https://github.com/sukkaw/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 curbengh December 1, 2019 07:58
@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.128% when pulling 8fc15f9 on SukkaW:external_link_regex into 5fba0a0 on hexojs:master.

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.

3 participants