mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 18:52:14 +03:00
🐛 Fixed changelog entry with emoji not being detected
no issue
This commit is contained in:
parent
89c555e29f
commit
d7c930d278
@ -3,7 +3,7 @@ const _ = require('lodash');
|
||||
|
||||
const timestamp = /^[0-9]{10} /;
|
||||
const separator = /^\* /;
|
||||
const hash = /^\[[0-9a-f]{9}\]/;
|
||||
const hash = /^\[[0-9a-f]{0,10}\]/;
|
||||
const url = /^\(https?:\/\/[^)]+\) /;
|
||||
|
||||
const getCommitMessageFromLine = line => line
|
||||
@ -21,6 +21,7 @@ module.exports.filterEmojiCommits = (content) => {
|
||||
const commitMessage = getCommitMessageFromLine(currentLine);
|
||||
|
||||
const match = emojiRegex().exec(commitMessage);
|
||||
|
||||
if (match && match.index === 0) {
|
||||
return emojiLines.concat(`* ${commitMessage}`);
|
||||
}
|
||||
|
@ -27,10 +27,11 @@ describe('Utils', function () {
|
||||
it('emoji commits found: just another format', function () {
|
||||
const result = lib.utils.filterEmojiCommits([
|
||||
'* [f6f35ebcd](https://github.com/TryGhost/Ghost/commit/f6f35ebcd) Version bump to 2.17.1 - Name',
|
||||
'* [f6f35ebcd](https://github.com/TryGhost/Ghost/commit/f6f35ebcd) 👻 Version bump to 2.17.1 - Name'
|
||||
'* [f6f35ebcd](https://github.com/TryGhost/Ghost/commit/f6f35ebcd) 👻 Version bump to 2.17.1 - Name',
|
||||
'* [e456ae2](https://github.com/kirrg001/testing/commit/e456ae2) 🐝 tzZZ - kirrg001'
|
||||
]);
|
||||
|
||||
result.length.should.eql(1);
|
||||
result.length.should.eql(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user