Skip to content

Commit d2b6417

Browse files
committed
Quartz sync: Jun 4, 2025, 11:17 AM
1 parent 82d8020 commit d2b6417

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

quartz/components/scripts/slide.inline.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ function renderMermaidInSlide() {
6464
})
6565
}
6666

67+
function anchorBlank(html: string): string {
68+
return html.replace(/<a\b([^>]*?)>/g, '<a $1 target="_blank">')
69+
}
6770

6871
function unwrapSlideNote(html: string): string {
6972
return html.replace(/<p>(\?{3}[\s\S]*?)<\/p>/g, (_, content) => content)
@@ -106,7 +109,15 @@ function appendRemark(option: SlideOptions) {
106109
}
107110

108111
const body = document.querySelector(".center article")?.innerHTML
109-
const data = unwrapSlideNote(unwrapFootnotesSection(collapseSeparators(injectSeparators(header + tags + body))))
112+
const data = anchorBlank(
113+
unwrapSlideNote(
114+
unwrapFootnotesSection(
115+
collapseSeparators(
116+
injectSeparators(header + tags + body)
117+
)
118+
)
119+
)
120+
)
110121
document.body.innerHTML = ""
111122

112123
const script = document.createElement("script")

0 commit comments

Comments
 (0)