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 parsing placeholder with trailing underscore at "new_post_name" #139

Conversation

@seaoak
Copy link
Member

seaoak commented Nov 21, 2019

Fix issue hexojs/hexo#3862

In _config.yml, the item new_post_name: takes a template string which includes placeholders.
The placeholders are such as :title, :year, :i_day.

The name of placeholders consists of alphanumeric characters and underscores.
But the last character should not be an underscore.
That is, trailing underscores of a placeholder should not be parsed as a part of the placeholder.

This patch fixes the RegExp to parse a placeholder.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Nov 21, 2019

Coverage Status

Coverage remained the same at 95.254% when pulling 745076c on seaoak:bugfix/fix-parsing-placeholder-with-trailing-underscore-at-new-post-name into ad3541e on hexojs:master.

@seaoak seaoak mentioned this pull request Nov 21, 2019
5 of 5 tasks complete
@seaoak seaoak requested a review from hexojs/core Nov 21, 2019
Copy link
Contributor

curbengh left a comment

Tested:

_posts/2019-11-19_test.md
new_post_name: :year-:month-:day_:title.md
# Existing config of hexo.io
_posts/2019-11-19-test.md
new_post_name: :year-:month-:day-:title.md
@SukkaW
SukkaW approved these changes Nov 22, 2019
@curbengh curbengh merged commit 851753f into hexojs:master Nov 22, 2019
3 checks passed
3 checks passed
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
coverage/coveralls Coverage remained the same at 95.254%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.