mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 04:16:17 +01:00 
			
		
		
		
	zip export - set note title as document.title
This commit is contained in:
		@@ -248,6 +248,7 @@ async function exportToZip(taskContext, branch, format, res, setHeaders = true)
 | 
				
			|||||||
        if (noteMeta.format === 'html') {
 | 
					        if (noteMeta.format === 'html') {
 | 
				
			||||||
            if (!content.substr(0, 100).toLowerCase().includes("<html")) {
 | 
					            if (!content.substr(0, 100).toLowerCase().includes("<html")) {
 | 
				
			||||||
                const cssUrl = `${"../".repeat(noteMeta.notePath.length - 1)}style.css`;
 | 
					                const cssUrl = `${"../".repeat(noteMeta.notePath.length - 1)}style.css`;
 | 
				
			||||||
 | 
					                const htmlTitle = utils.escapeHtml(title);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                // <base> element will make sure external links are openable - https://github.com/zadam/trilium/issues/1289#issuecomment-704066809
 | 
					                // <base> element will make sure external links are openable - https://github.com/zadam/trilium/issues/1289#issuecomment-704066809
 | 
				
			||||||
                content = `<html>
 | 
					                content = `<html>
 | 
				
			||||||
@@ -256,10 +257,11 @@ async function exportToZip(taskContext, branch, format, res, setHeaders = true)
 | 
				
			|||||||
    <meta name="viewport" content="width=device-width, initial-scale=1">
 | 
					    <meta name="viewport" content="width=device-width, initial-scale=1">
 | 
				
			||||||
    <link rel="stylesheet" href="${cssUrl}">
 | 
					    <link rel="stylesheet" href="${cssUrl}">
 | 
				
			||||||
    <base target="_parent">
 | 
					    <base target="_parent">
 | 
				
			||||||
 | 
					    <title>${htmlTitle}</title>
 | 
				
			||||||
</head>
 | 
					</head>
 | 
				
			||||||
<body>
 | 
					<body>
 | 
				
			||||||
  <div class="content">
 | 
					  <div class="content">
 | 
				
			||||||
      <h1>${utils.escapeHtml(title)}</h1>
 | 
					      <h1>${htmlTitle}</h1>
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      <div class="ck-content">${content}</div>
 | 
					      <div class="ck-content">${content}</div>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user