Skip to content

Commit 3a89ef5

Browse files
committed
Quartz sync: May 23, 2025, 7:12 PM
1 parent 17d1d3d commit 3a89ef5

File tree

1 file changed

+3
-28
lines changed

1 file changed

+3
-28
lines changed

quartz/components/MarkmapViewer.tsx

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import style from "./styles/markmap.scss"
44
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
55
import { classNames } from "../util/lang"
66
import { FullSlug } from "../util/path"
7-
87
import { IPureNode } from 'markmap-common'
98

109

@@ -63,37 +62,13 @@ export const parseInternalLinks = (slug: FullSlug) =>
6362
const MarkmapViewer: QuartzComponent = ({ displayClass, fileData }: QuartzComponentProps) => {
6463
const root = fileData.markmap
6564

66-
if (!root) {
67-
return (
68-
<div class={classNames(displayClass, "markmap")}>
69-
<button class={classNames(displayClass, "markmapmode")}>
70-
<svg
71-
xmlns="http://www.w3.org/2000/svg"
72-
class="markmapIcon"
73-
fill="currentColor"
74-
stroke="currentColor"
75-
stroke-width="0.2"
76-
stroke-linecap="round"
77-
stroke-linejoin="round"
78-
width="64px"
79-
height="64px"
80-
viewBox="0 -960 960 960"
81-
aria-label="mind map"
82-
>
83-
<title>mind map</title>
84-
<path d="M200-80q-50 0-85-35t-35-85q0-39 22.5-70t57.5-43v-87q0-50 35-85t85-35h160v-127q-35-12-57.5-43T360-760q0-50 35-85t85-35q50 0 85 35t35 85q0 39-22.5 70T520-647v127h160q50 0 85 35t35 85v87q35 12 57.5 43t22.5 70q0 50-35 85t-85 35q-50 0-85-35t-35-85q0-39 22.5-70t57.5-43v-87q0-17-11.5-28.5T680-440H520v127q35 12 57.5 43t22.5 70q0 50-35 85t-85 35q-50 0-85-35t-35-85q0-39 22.5-70t57.5-43v-127H280q-17 0-28.5 11.5T240-400v87q35 12 57.5 43t22.5 70q0 50-35 85t-85 35Zm0-80q17 0 28.5-11.5T240-200q0-17-11.5-28.5T200-240q-17 0-28.5 11.5T160-200q0 17 11.5 28.5T200-160Zm280 0q17 0 28.5-11.5T520-200q0-17-11.5-28.5T480-240q-17 0-28.5 11.5T440-200q0 17 11.5 28.5T480-160Zm280 0q17 0 28.5-11.5T800-200q0-17-11.5-28.5T760-240q-17 0-28.5 11.5T720-200q0 17 11.5 28.5T760-160ZM480-720q17 0 28.5-11.5T520-760q0-17-11.5-28.5T480-800q-17 0-28.5 11.5T440-760q0 17 11.5 28.5T480-720Z" />
85-
</svg>
86-
</button>
87-
</div>
88-
)
65+
if (root) {
66+
parseInternalLinks(fileData.slug!)(root)
8967
}
9068

91-
parseInternalLinks(fileData.slug!)(root)
92-
9369
return (
9470
<div class={classNames(displayClass, "markmap")}>
95-
96-
<button id="show-markmap" class={classNames(displayClass, "markmapmode")}>
71+
<button id={root ? "show-markmap" : ""} class={classNames(displayClass, "markmapmode")}>
9772
<svg
9873
xmlns="http://www.w3.org/2000/svg"
9974
class="markmapIcon"

0 commit comments

Comments
 (0)