From d4d13f31cd5aa95934f28123041b611602a70002 Mon Sep 17 00:00:00 2001 From: Florian Aumeier Date: Sat, 10 Aug 2024 18:15:24 +0200 Subject: [PATCH] fix: increase maximum file name length to match upper recommended limit for headlines --- package.json | 2 +- public/manifest.json | 2 +- src/file.test.ts | 4 ++-- src/file.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ceaf743..5820f95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-clipper", - "version": "0.2.1", + "version": "0.2.2", "description": "Obsidian Web Clipper Chrome Extension to save articles and pages from the web in Obsidian", "private": true, "scripts": { diff --git a/public/manifest.json b/public/manifest.json index c6b154e..0d103b0 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Obsidian Clipper", - "version": "0.2.1", + "version": "0.2.2", "description": "Obsidian Web Clipper Chrome Extension to save articles and pages from the web in Obsidian", "icons": { "16": "icons/icon_16.png", diff --git a/src/file.test.ts b/src/file.test.ts index f11f1af..ec300d9 100644 --- a/src/file.test.ts +++ b/src/file.test.ts @@ -27,9 +27,9 @@ describe('getFileName', () => { }); it('shortens filename if it exceeds max characters', () => { - const title = 'A'.repeat(61); + const title = 'A'.repeat(101); const result = getFileName(title); - expect(result.length).toBe(60); + expect(result.length).toBe(100); }); }); diff --git a/src/file.ts b/src/file.ts index e1c8c40..ba26766 100644 --- a/src/file.ts +++ b/src/file.ts @@ -102,5 +102,5 @@ export function getFileName( .replace(/\//g, '-') .replace(/\\/g, '-'); } - return fileName.slice(0, 60); + return fileName.slice(0, 100); }