mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	feat(export/md): update to latest turndown version (fixes #337)
This commit is contained in:
		
							
								
								
									
										14
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										14
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -13,6 +13,7 @@ | |||||||
|         "@electron/remote": "2.1.2", |         "@electron/remote": "2.1.2", | ||||||
|         "@excalidraw/excalidraw": "0.17.6", |         "@excalidraw/excalidraw": "0.17.6", | ||||||
|         "@highlightjs/cdn-assets": "11.11.1", |         "@highlightjs/cdn-assets": "11.11.1", | ||||||
|  |         "@joplin/turndown-plugin-gfm": "1.0.61", | ||||||
|         "@mermaid-js/layout-elk": "0.1.7", |         "@mermaid-js/layout-elk": "0.1.7", | ||||||
|         "@mind-elixir/node-menu": "1.0.4", |         "@mind-elixir/node-menu": "1.0.4", | ||||||
|         "@triliumnext/express-partial-content": "1.0.1", |         "@triliumnext/express-partial-content": "1.0.1", | ||||||
| @@ -60,7 +61,6 @@ | |||||||
|         "is-animated": "2.0.2", |         "is-animated": "2.0.2", | ||||||
|         "is-svg": "5.1.0", |         "is-svg": "5.1.0", | ||||||
|         "jimp": "1.6.0", |         "jimp": "1.6.0", | ||||||
|         "joplin-turndown-plugin-gfm": "1.0.12", |  | ||||||
|         "jquery": "3.7.1", |         "jquery": "3.7.1", | ||||||
|         "jquery-hotkeys": "0.2.2", |         "jquery-hotkeys": "0.2.2", | ||||||
|         "jquery.fancytree": "2.38.4", |         "jquery.fancytree": "2.38.4", | ||||||
| @@ -2638,6 +2638,12 @@ | |||||||
|         "node": ">=18" |         "node": ">=18" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/@joplin/turndown-plugin-gfm": { | ||||||
|  |       "version": "1.0.61", | ||||||
|  |       "resolved": "https://registry.npmjs.org/@joplin/turndown-plugin-gfm/-/turndown-plugin-gfm-1.0.61.tgz", | ||||||
|  |       "integrity": "sha512-m5PNP1OkktlGgmFI7r/HWON/vQA56GCiM1oTWYkY2JFc28Uc8yHj0nT46pahDyU8uRYPj4TXnxLjQzDDJ11i7w==", | ||||||
|  |       "license": "MIT" | ||||||
|  |     }, | ||||||
|     "node_modules/@jridgewell/gen-mapping": { |     "node_modules/@jridgewell/gen-mapping": { | ||||||
|       "version": "0.3.8", |       "version": "0.3.8", | ||||||
|       "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", |       "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", | ||||||
| @@ -11501,12 +11507,6 @@ | |||||||
|         "node": ">=18" |         "node": ">=18" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/joplin-turndown-plugin-gfm": { |  | ||||||
|       "version": "1.0.12", |  | ||||||
|       "resolved": "https://registry.npmjs.org/joplin-turndown-plugin-gfm/-/joplin-turndown-plugin-gfm-1.0.12.tgz", |  | ||||||
|       "integrity": "sha512-qL4+1iycQjZ1fs8zk3jSRk7cg3ROBUHk7GKtiLAQLFzLPKErnILUvz5DLszSQvz3s1sTjPbywLDISVUtBY6HaA==", |  | ||||||
|       "license": "MIT" |  | ||||||
|     }, |  | ||||||
|     "node_modules/jpeg-js": { |     "node_modules/jpeg-js": { | ||||||
|       "version": "0.4.4", |       "version": "0.4.4", | ||||||
|       "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", |       "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", | ||||||
|   | |||||||
| @@ -25,12 +25,10 @@ | |||||||
|     "start-server-no-dir": "cross-env TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 nodemon src/main.ts", |     "start-server-no-dir": "cross-env TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 nodemon src/main.ts", | ||||||
|     "start-test-server": "npm run switch-server && rimraf ./data-test && cross-env TRILIUM_DATA_DIR=./data-test TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev TRILIUM_PORT=9999 nodemon src/main.ts", |     "start-test-server": "npm run switch-server && rimraf ./data-test && cross-env TRILIUM_DATA_DIR=./data-test TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev TRILIUM_PORT=9999 nodemon src/main.ts", | ||||||
|     "qstart-server": "npm run switch-server && npm run start-server", |     "qstart-server": "npm run switch-server && npm run start-server", | ||||||
|  |  | ||||||
|     "start-electron": "cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron ./electron-main.ts --inspect=5858 .", |     "start-electron": "cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron ./electron-main.ts --inspect=5858 .", | ||||||
|     "start-electron-nix": "electron-rebuild --version 33.3.1 && cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev nix-shell -p electron_33 --run \"electron ./electron-main.ts --inspect=5858 .\"", |     "start-electron-nix": "electron-rebuild --version 33.3.1 && cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev nix-shell -p electron_33 --run \"electron ./electron-main.ts --inspect=5858 .\"", | ||||||
|     "start-electron-no-dir": "cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_ENV=dev electron --inspect=5858 .", |     "start-electron-no-dir": "cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_ENV=dev electron --inspect=5858 .", | ||||||
|     "start-electron-no-dir-nix": "electron-rebuild --version 33.3.1 && cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_ENV=dev nix-shell -p electron_33 --run \"electron ./electron-main.ts --inspect=5858 .\"", |     "start-electron-no-dir-nix": "electron-rebuild --version 33.3.1 && cross-env NODE_OPTIONS=\"--import tsx\" TRILIUM_ENV=dev nix-shell -p electron_33 --run \"electron ./electron-main.ts --inspect=5858 .\"", | ||||||
|  |  | ||||||
|     "start-electron-prod": "npm run prepare-dist && cross-env TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron ./dist/electron-main.js --inspect=5858 .", |     "start-electron-prod": "npm run prepare-dist && cross-env TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron ./dist/electron-main.js --inspect=5858 .", | ||||||
|     "start-electron-prod-nix": "electron-rebuild --version 33.3.1 && npm run prepare-dist && cross-env TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev nix-shell -p electron_33 --run \"electron ./dist/electron-main.js --inspect=5858 .\"", |     "start-electron-prod-nix": "electron-rebuild --version 33.3.1 && npm run prepare-dist && cross-env TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev nix-shell -p electron_33 --run \"electron ./dist/electron-main.js --inspect=5858 .\"", | ||||||
|     "start-electron-prod-no-dir": "npm run prepare-dist && cross-env TRILIUM_ENV=dev electron --inspect=5858 .", |     "start-electron-prod-no-dir": "npm run prepare-dist && cross-env TRILIUM_ENV=dev electron --inspect=5858 .", | ||||||
| @@ -64,6 +62,7 @@ | |||||||
|     "@electron/remote": "2.1.2", |     "@electron/remote": "2.1.2", | ||||||
|     "@excalidraw/excalidraw": "0.17.6", |     "@excalidraw/excalidraw": "0.17.6", | ||||||
|     "@highlightjs/cdn-assets": "11.11.1", |     "@highlightjs/cdn-assets": "11.11.1", | ||||||
|  |     "@joplin/turndown-plugin-gfm": "1.0.61", | ||||||
|     "@mermaid-js/layout-elk": "0.1.7", |     "@mermaid-js/layout-elk": "0.1.7", | ||||||
|     "@mind-elixir/node-menu": "1.0.4", |     "@mind-elixir/node-menu": "1.0.4", | ||||||
|     "@triliumnext/express-partial-content": "1.0.1", |     "@triliumnext/express-partial-content": "1.0.1", | ||||||
| @@ -111,7 +110,6 @@ | |||||||
|     "is-animated": "2.0.2", |     "is-animated": "2.0.2", | ||||||
|     "is-svg": "5.1.0", |     "is-svg": "5.1.0", | ||||||
|     "jimp": "1.6.0", |     "jimp": "1.6.0", | ||||||
|     "joplin-turndown-plugin-gfm": "1.0.12", |  | ||||||
|     "jquery": "3.7.1", |     "jquery": "3.7.1", | ||||||
|     "jquery-hotkeys": "0.2.2", |     "jquery-hotkeys": "0.2.2", | ||||||
|     "jquery.fancytree": "2.38.4", |     "jquery.fancytree": "2.38.4", | ||||||
|   | |||||||
| @@ -68,4 +68,10 @@ describe("Markdown export", () => { | |||||||
|  |  | ||||||
|         expect(markdownExportService.toMarkdown(html)).toBe(expected); |         expect(markdownExportService.toMarkdown(html)).toBe(expected); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|  |     it("exports strikethrough text correctly", () => { | ||||||
|  |         const html = "<s>hello</s>Hello <s>world</s>"; | ||||||
|  |         const expected = "~~hello~~Hello ~~world~~"; | ||||||
|  |         expect(markdownExportService.toMarkdown(html)).toBe(expected); | ||||||
|  |     }); | ||||||
| }); | }); | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| "use strict"; | "use strict"; | ||||||
|  |  | ||||||
| import TurndownService from "turndown"; | import TurndownService from "turndown"; | ||||||
| import turndownPluginGfm from "joplin-turndown-plugin-gfm"; | import turndownPluginGfm from "@joplin/turndown-plugin-gfm"; | ||||||
|  |  | ||||||
| let instance: TurndownService | null = null; | let instance: TurndownService | null = null; | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								src/types.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/types.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -18,7 +18,7 @@ declare module "normalize-strings" { | |||||||
|     export default normalizeString; |     export default normalizeString; | ||||||
| } | } | ||||||
|  |  | ||||||
| declare module "joplin-turndown-plugin-gfm" { | declare module "@joplin/turndown-plugin-gfm" { | ||||||
|     import TurndownService from "turndown"; |     import TurndownService from "turndown"; | ||||||
|     namespace gfm { |     namespace gfm { | ||||||
|         function gfm(service: TurndownService): void; |         function gfm(service: TurndownService): void; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user