From e7f44cb3a49c2c1e3bdc6cf01929d5bc5ecdc3e2 Mon Sep 17 00:00:00 2001 From: Karey Higuera Date: Wed, 10 Nov 2021 06:46:40 -0600 Subject: [PATCH] avoid removing file extension when sanitizing filename --- manifest.json | 2 +- package.json | 2 +- src/util.ts | 3 +-- versions.json | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index 5d35f01..21cc29d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-tweet-to-markdown", "name": "Tweet to Markdown", - "version": "1.1.1", + "version": "1.1.2", "minAppVersion": "0.12.16", "description": "Save tweets as Markdown files, along with their images, polls, etc.", "author": "kbravh", diff --git a/package.json b/package.json index 26300c3..aea1053 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-tweet-to-markdown", - "version": "1.1.1", + "version": "1.1.2", "description": "Save tweets as beautiful markdown files in Obsidian (https://obsidian.md)", "main": "main.js", "engines": { diff --git a/src/util.ts b/src/util.ts index 4d16c4d..35ebed2 100644 --- a/src/util.ts +++ b/src/util.ts @@ -96,8 +96,7 @@ export const createFilename = (tweet: Tweet, filename = ''): string => { filename = filename.replace('[[handle]]', tweet.includes.users[0].username) filename = filename.replace('[[id]]', tweet.data.id) filename = filename.replace('[[text]]', tweet.data.text) - filename += '.md' - return sanitize(filename) + return sanitize(filename) + '.md' } /** diff --git a/versions.json b/versions.json index 868b635..5035af4 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,3 @@ { - "1.1.1": "0.12.16" + "1.1.2": "0.12.16" }