diff --git a/manifest.json b/manifest.json index b801fcc..3d1529e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-kindle-plugin", "name": "Kindle Highlights", - "version": "1.6.9", + "version": "1.6.10", "description": "Sync your Kindle book highlights using your Amazon login or uploading your My Clippings file", "minAppVersion": "0.10.2", "author": "Hady Osman", diff --git a/package.json b/package.json index 8893973..1ac1186 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-kindle-plugin", - "version": "1.6.9", + "version": "1.6.10", "description": "Sync your Kindle book highlights using your Amazon login or uploading your My Clippings file", "main": "src/index.ts", "repository": { diff --git a/src/utils/shortenTitle.spec.ts b/src/utils/shortenTitle.spec.ts index a78f692..9e9852d 100644 --- a/src/utils/shortenTitle.spec.ts +++ b/src/utils/shortenTitle.spec.ts @@ -38,4 +38,9 @@ describe('Santize title for Obsidian environment', () => { const santizedTitle = shortenTitle(' The Warm-Hearted Snowman '); expect(santizedTitle).toEqual('The Warm-Hearted Snowman'); }); + + it('replace [] with ()', () => { + const santizedTitle = shortenTitle('Ricochet Joe [Kindle in Motion]'); + expect(santizedTitle).toEqual('Ricochet Joe (Kindle in Motion)'); + }); }); diff --git a/src/utils/shortenTitle.ts b/src/utils/shortenTitle.ts index 8f87c17..e070a63 100644 --- a/src/utils/shortenTitle.ts +++ b/src/utils/shortenTitle.ts @@ -3,5 +3,7 @@ export const shortenTitle = (title: string): string => { .replace(/ *\([^)]*\) */g, '') // remove parenthesis and contents from title .replace(/:([^:]*)$/g, '') // remove text after last colon .replace(/[']/g, '') // remove single quotes from title + .replace('[', '(') // replace [ with ( + .replace(']', ')') // replace ] with ) .trim(); };