Skip to content

Commit eff19f4

Browse files
committed
ui: pdf embed: also allow url starting with /
1 parent 91119e1 commit eff19f4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/ui-default/backendlib/markdown-it-media.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function Media(md: MarkdownIt) {
101101
if (result) return result;
102102
}
103103
if (service === 'pdf') {
104-
if (src.startsWith('file://') || src.startsWith('./')) src += src.includes('?') ? '&noDisposition=1' : '?noDisposition=1';
104+
if (src.startsWith('file://') || src.startsWith('./') || (src[1] === '/' && src[2] !== '/')) src += src.includes('?') ? '&noDisposition=1' : '?noDisposition=1';
105105
// A response with has content-disposition header causes the browser to download the file automatically.
106106
// As we cannot control response header from external sites, we block embedding external PDFs.
107107
else return '<p>Embedding an external PDF is no longer supported.</p>';

0 commit comments

Comments
 (0)