Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/gitmoji-changelog-markdown/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function getShortHash(hash, repository) {

if (isEmpty(repository) || !repository.url) return shortHash

return `[${shortHash}](${repository.url}/commit/${hash})`
return `[\`${shortHash}\`](${repository.url}/commit/${hash})`
}

const ISSUE_REGEXP = /#{1}(\d+)/gm
Expand All @@ -153,7 +153,7 @@ function autolink(message, repository) {
const matches = message.match(ISSUE_REGEXP)
if (!matches) return message

return message.replace(ISSUE_REGEXP, `[#$1](${repository.bugsUrl}/$1)`)
return message.replace(ISSUE_REGEXP, `[\`#$1\`](${repository.bugsUrl}/$1)`)
}

module.exports = {
Expand Down
14 changes: 7 additions & 7 deletions packages/gitmoji-changelog-markdown/src/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ describe('Markdown converter', () => {

### Changed

- ♻️ Upgrade brand new feature [[c40ee86](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23c)]
- ♻️ Upgrade brand new feature [[`c40ee86`](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23c)]


<a name="1.0.0"></a>
## 1.0.0 (2018-08-28)

### Added

- ✨ Upgrade brand new feature [[c40ee86](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23f)]
- ✨ Upgrade brand new feature [[&#x60;c40ee86&#x60;](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23f)]


`)
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('Markdown converter', () => {

### Changed

- ♻️ Upgrade brand new feature [[c40ee86](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23c)] (by John Doe)
- ♻️ Upgrade brand new feature [[&#x60;c40ee86&#x60;](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23c)] (by John Doe)


`)
Expand Down Expand Up @@ -230,7 +230,7 @@ I am the last version

### Changed

- ♻️ Upgrade brand new feature [[c40ee86](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23c)]
- ♻️ Upgrade brand new feature [[&#x60;c40ee86&#x60;](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23c)]


<a name="1.0.0"></a>
Expand All @@ -255,7 +255,7 @@ describe('getHashUrl', () => {
const result = getShortHash('xxxxxxxxxxxxxxxxx', {
url: 'https://github.com/frinyvonnick/gitmoji-changelog',
})
expect(result).toBe('[xxxxxxx](https://github.com/frinyvonnick/gitmoji-changelog/commit/xxxxxxxxxxxxxxxxx)')
expect(result).toBe('[`xxxxxxx`](https://github.com/frinyvonnick/gitmoji-changelog/commit/xxxxxxxxxxxxxxxxx)')
})
})

Expand All @@ -279,14 +279,14 @@ describe('autolink', () => {
const result = autolink(':bug: fix issue #123', {
bugsUrl: 'https://github.com/frinyvonnick/gitmoji-changelog/issues',
})
expect(result).toBe(':bug: fix issue [#123](https://github.com/frinyvonnick/gitmoji-changelog/issues/123)')
expect(result).toBe(':bug: fix issue [`#123`](https://github.com/frinyvonnick/gitmoji-changelog/issues/123)')
})

it('should autolink with markdown severals hashtag issues in message', () => {
const result = autolink(':bug: fix issue #123 and #456', {
bugsUrl: 'https://github.com/frinyvonnick/gitmoji-changelog/issues',
})
expect(result).toBe(':bug: fix issue [#123](https://github.com/frinyvonnick/gitmoji-changelog/issues/123) and [#456](https://github.com/frinyvonnick/gitmoji-changelog/issues/456)')
expect(result).toBe(':bug: fix issue [`#123`](https://github.com/frinyvonnick/gitmoji-changelog/issues/123) and [`#456`](https://github.com/frinyvonnick/gitmoji-changelog/issues/456)')
})
})

Expand Down