diff --git a/packages/gitmoji-changelog-markdown/src/index.js b/packages/gitmoji-changelog-markdown/src/index.js
index 7db3bed..50ecaf8 100755
--- a/packages/gitmoji-changelog-markdown/src/index.js
+++ b/packages/gitmoji-changelog-markdown/src/index.js
@@ -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
@@ -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 = {
diff --git a/packages/gitmoji-changelog-markdown/src/index.spec.js b/packages/gitmoji-changelog-markdown/src/index.spec.js
index 6d9043d..2184ef3 100644
--- a/packages/gitmoji-changelog-markdown/src/index.spec.js
+++ b/packages/gitmoji-changelog-markdown/src/index.spec.js
@@ -82,7 +82,7 @@ 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)]
@@ -90,7 +90,7 @@ describe('Markdown converter', () => {
### Added
-- ✨ Upgrade brand new feature [[c40ee86](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23f)]
+- ✨ Upgrade brand new feature [[`c40ee86`](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23f)]
`)
@@ -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 [[`c40ee86`](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23c)] (by John Doe)
`)
@@ -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 [[`c40ee86`](https://github.com/frinyvonnick/gitmoji-changelog/commit/c40ee8669ba7ea5151adc2942fa8a7fc98d9e23c)]
@@ -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)')
})
})
@@ -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)')
})
})