+
+
+
+ {err ? (
+
{err}
+ ) : text == null ? (
+
Loading…
+ ) : (
+
+ )}
+
+
+
+
+ )
+}
+
+// The pane header carries the title, so a leading `# Heading` is lifted out of
+// the body rather than rendered a second time under it.
+function splitLeadingHeading(text: string): { title: string; body: string } {
+ const m = /^\s*#\s+(.+?)[ \t]*(?:\n|$)/.exec(text)
+ if (!m) return { title: '', body: text }
+ return { title: m[1], body: text.slice(m[0].length) }
+}
+
+// index.md links a page as `[Title](pages/