mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	Merge branch 'stable'
This commit is contained in:
		
						commit
						2c7b774356
					
				
							
								
								
									
										4
									
								
								libraries/ckeditor/ckeditor.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								libraries/ckeditor/ckeditor.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										4
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -1,12 +1,12 @@ | ||||
| { | ||||
|   "name": "trilium", | ||||
|   "version": "0.62.4", | ||||
|   "version": "0.62.5", | ||||
|   "lockfileVersion": 2, | ||||
|   "requires": true, | ||||
|   "packages": { | ||||
|     "": { | ||||
|       "name": "trilium", | ||||
|       "version": "0.62.4", | ||||
|       "version": "0.62.5", | ||||
|       "hasInstallScript": true, | ||||
|       "license": "AGPL-3.0-only", | ||||
|       "dependencies": { | ||||
|  | ||||
| @ -302,7 +302,7 @@ const DEFAULT_KEYBOARD_ACTIONS = [ | ||||
|     }, | ||||
|     { | ||||
|         actionName: "lastTab", | ||||
|         defaultShortcuts: ["CommandOrControl+0"], | ||||
|         defaultShortcuts: [], | ||||
|         description: "Activates the last tab in the list", | ||||
|         scope: "window" | ||||
|     }, | ||||
|  | ||||
| @ -471,6 +471,8 @@ function findRelationMapLinks(content, foundLinks) { | ||||
| const imageUrlToAttachmentIdMapping = {}; | ||||
| 
 | ||||
| async function downloadImage(noteId, imageUrl) { | ||||
|     const unescapedUrl = utils.unescapeHtml(imageUrl); | ||||
| 
 | ||||
|     try { | ||||
|         let imageBuffer; | ||||
| 
 | ||||
| @ -487,10 +489,10 @@ async function downloadImage(noteId, imageUrl) { | ||||
|                 }); | ||||
|             }); | ||||
|         } else { | ||||
|             imageBuffer = await request.getImage(imageUrl); | ||||
|             imageBuffer = await request.getImage(unescapedUrl); | ||||
|         } | ||||
| 
 | ||||
|         const parsedUrl = url.parse(imageUrl); | ||||
|         const parsedUrl = url.parse(unescapedUrl); | ||||
|         const title = path.basename(parsedUrl.pathname); | ||||
| 
 | ||||
|         const imageService = require('../services/image.js'); | ||||
| @ -519,7 +521,7 @@ function downloadImages(noteId, content) { | ||||
|     let imageMatch; | ||||
| 
 | ||||
|     while (imageMatch = imageRe.exec(content)) { | ||||
|         let url = imageMatch[1]; | ||||
|         const url = imageMatch[1]; | ||||
|         const inlineImageMatch = /^data:image\/[a-z]+;base64,/.exec(url); | ||||
| 
 | ||||
|         if (inlineImageMatch) { | ||||
| @ -541,8 +543,6 @@ function downloadImages(noteId, content) { | ||||
|                 continue; | ||||
|             } | ||||
| 
 | ||||
|             url = utils.unescapeHtml(url); | ||||
| 
 | ||||
|             if (url in imageUrlToAttachmentIdMapping) { | ||||
|                 const attachment = becca.getAttachment(imageUrlToAttachmentIdMapping[url]); | ||||
| 
 | ||||
|  | ||||
| @ -137,7 +137,7 @@ function renderCode(result) { | ||||
| 
 | ||||
| function renderMermaid(result, note) { | ||||
|     result.content = ` | ||||
| <img src="api/images/${note.noteId}/${note.escapedTitle}?${note.utcDateModified}"> | ||||
| <img src="api/images/${note.noteId}/${note.encodedTitle}?${note.utcDateModified}"> | ||||
| <hr> | ||||
| <details> | ||||
|     <summary>Chart source</summary> | ||||
| @ -146,7 +146,7 @@ function renderMermaid(result, note) { | ||||
| } | ||||
| 
 | ||||
| function renderImage(result, note) { | ||||
|     result.content = `<img src="api/images/${note.noteId}/${note.escapedTitle}?${note.utcDateModified}">`; | ||||
|     result.content = `<img src="api/images/${note.noteId}/${note.encodedTitle}?${note.utcDateModified}">`; | ||||
| } | ||||
| 
 | ||||
| function renderFile(note, result) { | ||||
|  | ||||
| @ -490,6 +490,10 @@ class SNote extends AbstractShacaEntity { | ||||
|         return escape(this.title); | ||||
|     } | ||||
| 
 | ||||
|     get encodedTitle() { | ||||
|         return encodeURIComponent(this.title); | ||||
|     } | ||||
| 
 | ||||
|     getPojo() { | ||||
|         return { | ||||
|             noteId: this.noteId, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam