mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	Merge remote-tracking branch 'origin/master'
This commit is contained in:
		
						commit
						a19c58703f
					
				@ -10,6 +10,7 @@ import ScreenContainer from "../widgets/mobile_widgets/screen_container.js";
 | 
				
			|||||||
import ScrollingContainer from "../widgets/containers/scrolling_container.js";
 | 
					import ScrollingContainer from "../widgets/containers/scrolling_container.js";
 | 
				
			||||||
import ProtectedSessionPasswordDialog from "../widgets/dialogs/protected_session_password.js";
 | 
					import ProtectedSessionPasswordDialog from "../widgets/dialogs/protected_session_password.js";
 | 
				
			||||||
import ConfirmDialog from "../widgets/dialogs/confirm.js";
 | 
					import ConfirmDialog from "../widgets/dialogs/confirm.js";
 | 
				
			||||||
 | 
					import FilePropertiesWidget from "../widgets/ribbon_widgets/file_properties.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const MOBILE_CSS = `
 | 
					const MOBILE_CSS = `
 | 
				
			||||||
<style>
 | 
					<style>
 | 
				
			||||||
@ -128,7 +129,7 @@ export default class MobileLayout {
 | 
				
			|||||||
                        .child(
 | 
					                        .child(
 | 
				
			||||||
                            new NoteDetailWidget()
 | 
					                            new NoteDetailWidget()
 | 
				
			||||||
                                .css('padding', '5px 20px 10px 0')
 | 
					                                .css('padding', '5px 20px 10px 0')
 | 
				
			||||||
                        )
 | 
					                        ).child(new FilePropertiesWidget().css('font-size','smaller'))
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            .child(new ProtectedSessionPasswordDialog())
 | 
					            .child(new ProtectedSessionPasswordDialog())
 | 
				
			||||||
 | 
				
			|||||||
@ -292,7 +292,12 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
 | 
				
			|||||||
            content = content.replace(/<\/body>.*<\/html>/gis, "");
 | 
					            content = content.replace(/<\/body>.*<\/html>/gis, "");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            content = content.replace(/src="([^"]*)"/g, (match, url) => {
 | 
					            content = content.replace(/src="([^"]*)"/g, (match, url) => {
 | 
				
			||||||
                url = decodeURIComponent(url);
 | 
					                try {
 | 
				
			||||||
 | 
					                    url = decodeURIComponent(url);
 | 
				
			||||||
 | 
					                } catch (e) {
 | 
				
			||||||
 | 
					                    log.error(`Cannot parse image URL '${url}', keeping original (${e}).`);
 | 
				
			||||||
 | 
					                    return `src="${url}"`;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (isUrlAbsolute(url) || url.startsWith("/")) {
 | 
					                if (isUrlAbsolute(url) || url.startsWith("/")) {
 | 
				
			||||||
                    return match;
 | 
					                    return match;
 | 
				
			||||||
@ -304,7 +309,12 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
 | 
				
			|||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            content = content.replace(/href="([^"]*)"/g, (match, url) => {
 | 
					            content = content.replace(/href="([^"]*)"/g, (match, url) => {
 | 
				
			||||||
                url = decodeURIComponent(url);
 | 
					                try {
 | 
				
			||||||
 | 
					                    url = decodeURIComponent(url);
 | 
				
			||||||
 | 
					                } catch (e) {
 | 
				
			||||||
 | 
					                    log.error(`Cannot parse link URL '${url}', keeping original (${e}).`);
 | 
				
			||||||
 | 
					                    return `href="${url}"`;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (isUrlAbsolute(url)) {
 | 
					                if (isUrlAbsolute(url)) {
 | 
				
			||||||
                    return match;
 | 
					                    return match;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user