fix(post-asset): strip extensions better on permalink#5153
fix(post-asset): strip extensions better on permalink#5153yoshinorin merged 2 commits intohexojs:masterfrom syunaht:fix
Conversation
How to testgit clone -b fix https://github.com/KagamigawaMeguri/hexo.git
cd hexo
npm install
npm test |
stevenjoezhang
left a comment
There was a problem hiding this comment.
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. |
yoshinorin
left a comment
There was a problem hiding this comment.
@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