Skip to content

Commit 80a6733

Browse files
yoomlamclaude
andcommitted
fix(lik-ui): strip YAML frontmatter before Markdown render
The closing "---" of a SKILL.md's frontmatter was read by marked as a setext heading underline, rendering the name/description block as a giant heading. Strip the leading frontmatter (already shown above the block) before parsing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5bbde3a commit 80a6733

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lik-ui/src/lik_ui/templates/connections.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,15 @@ <h1>Connections</h1>
131131
box.appendChild(link);
132132
var md = document.createElement("div");
133133
md.className = "skill-instructions";
134+
// Drop the leading YAML frontmatter (name/description, already shown above): its
135+
// closing "---" would otherwise read as a setext heading underline and render the
136+
// whole block as a giant heading.
137+
var body = res.d.instructions.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/, "");
134138
if (window.marked && window.DOMPurify) {
135-
md.innerHTML = window.DOMPurify.sanitize(window.marked.parse(res.d.instructions));
139+
md.innerHTML = window.DOMPurify.sanitize(window.marked.parse(body));
136140
} else {
137141
var pre = document.createElement("pre");
138-
pre.textContent = res.d.instructions;
142+
pre.textContent = body;
139143
md.appendChild(pre);
140144
}
141145
box.appendChild(md);

0 commit comments

Comments
 (0)