mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	fix(client): "Note not found" tooltip for some URLs
This commit is contained in:
		| @@ -6,4 +6,14 @@ describe("Link", () => { | |||||||
|         const output = parseNavigationStateFromUrl("http://localhost:8080/#?searchString=hello"); |         const output = parseNavigationStateFromUrl("http://localhost:8080/#?searchString=hello"); | ||||||
|         expect(output).toMatchObject({ searchString: "hello" }); |         expect(output).toMatchObject({ searchString: "hello" }); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|  |     it("parses searchString with hash", () => { | ||||||
|  |         const output = parseNavigationStateFromUrl("https://github.com/orgs/TriliumNext/discussions/1526#discussioncomment-12656660"); | ||||||
|  |         expect(output).toStrictEqual({}); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     it("parses notePath", () => { | ||||||
|  |         const output = parseNavigationStateFromUrl(`#root/WWaBNf3SSA1b/mQ2tIzLVFKHL`); | ||||||
|  |         expect(output).toMatchObject({ notePath: "root/WWaBNf3SSA1b/mQ2tIzLVFKHL", noteId: "mQ2tIzLVFKHL" }); | ||||||
|  |     }); | ||||||
| }); | }); | ||||||
|   | |||||||
| @@ -238,10 +238,14 @@ export function parseNavigationStateFromUrl(url: string | undefined) { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     if (!notePath.match(/^[_a-z0-9]{4,}(\/[_a-z0-9]{4,})*$/i)) { |     if (searchString) { | ||||||
|         return { searchString } |         return { searchString } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     if (!notePath.match(/^[_a-z0-9]{4,}(\/[_a-z0-9]{4,})*$/i)) { | ||||||
|  |         return {}; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     return { |     return { | ||||||
|         notePath, |         notePath, | ||||||
|         noteId: treeService.getNoteIdFromUrl(notePath), |         noteId: treeService.getNoteIdFromUrl(notePath), | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user