diff --git a/package-lock.json b/package-lock.json index 67c101c8..cba755c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2164,9 +2164,9 @@ "dev": true }, "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", + "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", "dev": true }, "interpret": { diff --git a/src/util.ts b/src/util.ts index ba2ed96e..64368075 100644 --- a/src/util.ts +++ b/src/util.ts @@ -223,8 +223,8 @@ export function slugify(heading: string, mode?: string, downcase?: boolean) { slug = slugifyMethods.azureDevops(slug); break; - case 'bitbucket-cloud': - slug = 'markdown-header-' + slugifyMethods.github(slug); + case 'bitbucketCloud': + slug = slugifyMethods.bitbucketCloud(slug); break; default: @@ -256,6 +256,18 @@ const slugifyMethods: { readonly [mode: string]: (text: string) => string; } = { return slug; }, + /** + * Bitbucket Cloud + */ + "bitbucketCloud": (slug: string): string => { + // https://support.atlassian.com/bitbucket-cloud/docs/readme-content/ + // https://bitbucket.org/tutorials/markdowndemo/ + slug = 'markdown-header-' + + slugifyMethods.github(slug).replace(/-+/g, '-'); + + return slug; + }, + /** * GitHub slugify function */