mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
fix(tasks): correct URL basename extraction for trailing slashes
URLs ending with '/' were incorrectly truncating the last character of the path segment when extracting attachment titles. Example fix: - Input: https://example.com/path/ - Before: "pat" (lost one character) - After: "path" (correct) Changed substring offset from -2 to -1 to properly remove only the trailing slash character.
This commit is contained in:
parent
c49209d364
commit
22adb1df45
1 changed files with 1 additions and 1 deletions
|
|
@ -547,7 +547,7 @@ const _baseNameForUrl = (passedStr: string): string => {
|
|||
const str = passedStr.trim();
|
||||
let base;
|
||||
if (str[str.length - 1] === '/') {
|
||||
const strippedStr = str.substring(0, str.length - 2);
|
||||
const strippedStr = str.substring(0, str.length - 1);
|
||||
base = strippedStr.substring(strippedStr.lastIndexOf('/') + 1);
|
||||
} else {
|
||||
base = str.substring(str.lastIndexOf('/') + 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue