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

fix(excerpt): stricter regex #4443

Merged
merged 1 commit into from Jul 25, 2020
Merged

fix(excerpt): stricter regex #4443

merged 1 commit into from Jul 25, 2020

Conversation

curbengh
Copy link
Contributor

@curbengh curbengh commented Jul 25, 2020

What does it do?

The current regex to detect the excerpt tag <!-- more --> is too lenient, it matches <!--- more ---> and even

<!--
more
-->

This PR restricts it to two dashes only and zero or one space.

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.

@curbengh
Copy link
Contributor Author

curbengh commented Jul 25, 2020

I label it BC in case users are not using the proper syntax.


Removed the label, the docs has always mention the syntax is <!-- more -->.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.237% when pulling de63ab9 on curbengh:rexcerpt into 49ff2b2 on hexojs:master.

@curbengh curbengh merged commit 562e97e into hexojs:master Jul 25, 2020
@curbengh curbengh deleted the rexcerpt branch July 25, 2020 11:01
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