mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 04:16:17 +01:00 
			
		
		
		
	Fix svg not previewing in revisions
This commit is contained in:
		@@ -269,8 +269,9 @@ export default class RevisionsDialog extends BasicWidget {
 | 
				
			|||||||
            this.$content.html($("<pre>").text(fullRevision.content));
 | 
					            this.$content.html($("<pre>").text(fullRevision.content));
 | 
				
			||||||
        } else if (revisionItem.type === 'image') {
 | 
					        } else if (revisionItem.type === 'image') {
 | 
				
			||||||
            if (fullRevision.mime === "image/svg+xml") {
 | 
					            if (fullRevision.mime === "image/svg+xml") {
 | 
				
			||||||
 | 
					                let encodedSVG = encodeURIComponent(fullRevision.content); //Base64 of other format images may be embedded in svg
 | 
				
			||||||
                this.$content.html($("<img>")
 | 
					                this.$content.html($("<img>")
 | 
				
			||||||
                    .attr("src", `data:${fullRevision.mime};utf8,${fullRevision.content}`)
 | 
					                    .attr("src", `data:${fullRevision.mime};utf8,${encodedSVG}`)
 | 
				
			||||||
                    .css("max-width", "100%")
 | 
					                    .css("max-width", "100%")
 | 
				
			||||||
                    .css("max-height", "100%"));
 | 
					                    .css("max-height", "100%"));
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user