-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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(post-asset): strip extensions better on permalink #5153
Conversation
How to testgit clone -b fix https://github.com/KagamigawaMeguri/hexo.git
cd hexo
npm install
npm test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can consider modifying the hexo-abbrlink plugin instead?
Others have consulted the hexo-abbrlink plugin developer, and he thinks it's hexo's problem. |
I'm not yet checking the behavior of But I think maybe we can merge this. Because this PR passes all of the current tests. Also, it includes #2881 for fixes #2134. But we should change the PR title and source code comment. We should not change the source code for third-party plugins behavior. |
Thank you for your patience and guidance! Please review again if my changes match your explanation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KagamigawaMeguri
Sorry for the late reply.
LGTM, I'll merge this. Thank you :)
Is this a breaking change? |
It looks like this PR did not run check. and I tested in my PC. 1146 passing (16s)
5 pending
1 failing
1) Hexo
Models
PostAsset
path - virtual - when permalink contains .htm not in the end:
AssertionError: expected '2023\09\24\bar\bar\foo.html' to deeply equal '2023\09\24\bar\.htm-foo\foo.html'
+ expected - actual
-2023\09\24\bar\bar\foo.html
+2023\09\24\bar\.htm-foo\foo.html
at Context.<anonymous> (D:\git\hexo\test\scripts\models\post_asset.js:95:22) |
What does it do?
Fixes #2134
Closes #2881
A better way to strip extensions on permalink in post-asset.js
To some degree, it is possible to increase plugin compatibility.
Pull request tasks