mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	fix(markdown/import): markdown quotes not escaping
This commit is contained in:
		| @@ -127,4 +127,10 @@ second line 2</code></pre><ul><li>Hello</li><li>world</li></ul><ol><li>Hello</li | ||||
|         expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected); | ||||
|     }); | ||||
|  | ||||
|     it("does not escape unneeded characters", () => { | ||||
|         const input = `It's important to note that these examples are not natively supported by Trilium out of the box; instead, they demonstrate what you can build within Trilium.`; | ||||
|         const expected = `<p>It's important to note that these examples are not natively supported by Trilium out of the box; instead, they demonstrate what you can build within Trilium.</p>`; | ||||
|         expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected); | ||||
|     }); | ||||
|  | ||||
| }); | ||||
|   | ||||
| @@ -82,7 +82,7 @@ function renderToHtml(content: string, title: string) { | ||||
|  | ||||
|     // h1 handling needs to come before sanitization | ||||
|     html = importUtils.handleH1(html, title); | ||||
|     // html = htmlSanitizer.sanitize(html); | ||||
|     html = htmlSanitizer.sanitize(html); | ||||
|  | ||||
|     // Remove slash for self-closing tags to match CKEditor's approach. | ||||
|     html = html.replace(/<(\w+)([^>]*)\s+\/>/g, "<$1$2>"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user