From 02b5811b95abf1b6102f1cbce2afc9cace1f3cb4 Mon Sep 17 00:00:00 2001 From: harshbansal7 Date: Wed, 18 Feb 2026 16:58:27 +0530 Subject: [PATCH] add support for \r as well --- pkg/skills/loader.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/skills/loader.go b/pkg/skills/loader.go index 15e82c31b..c9731b6ae 100644 --- a/pkg/skills/loader.go +++ b/pkg/skills/loader.go @@ -313,9 +313,10 @@ func (sl *SkillsLoader) parseSimpleYAML(content string) map[string]string { } func (sl *SkillsLoader) extractFrontmatter(content string) string { - // Support both Unix (\n) and Windows (\r\n) line endings for frontmatter blocks - // (?s) enables DOTALL so . matches newlines; ^--- at start, then ... --- at start of line - re := regexp.MustCompile(`(?s)^---\r?\n(.*?)\r?\n---`) + // Support \n (Unix), \r\n (Windows), and \r (classic Mac) line endings for frontmatter blocks + // (?s) enables DOTALL so . matches newlines; + // ^--- at start, then ... --- at start of line, honoring all three line ending types + re := regexp.MustCompile(`(?s)^---(?:\r\n|\n|\r)(.*?)(?:\r\n|\n|\r)---`) match := re.FindStringSubmatch(content) if len(match) > 1 { return match[1]