mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
added base element to handle external links in exports, #1289
This commit is contained in:
parent
32d609e796
commit
287ef9b522
@ -226,11 +226,13 @@ function exportToZip(taskContext, branch, format, res) {
|
|||||||
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';
|
||||||
|
|
||||||
|
// <base> element will make sure external links are openable - https://github.com/zadam/trilium/issues/1289#issuecomment-704066809
|
||||||
content = `<html>
|
content = `<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<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">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>${utils.escapeHtml(title)}</h1>
|
<h1>${utils.escapeHtml(title)}</h1>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user