fix(skills): preserve escaped quotes in frontmatter lists (#6265)

* fix(skills): preserve escaped quotes in frontmatter lists

* test(skills): use descriptive frontmatter examples

---------

Co-authored-by: Bolt4243 <277300782+Bolt4243@users.noreply.github.com>
This commit is contained in:
MBGA
2026-10-31 13:02:02 +00:00
committed by GitHub
co-authored by Bolt4243
parent 9a1fdb192e
commit 2019a97339
2 changed files with 60 additions and 1 deletions
+6 -1
View File
@@ -130,10 +130,15 @@ def _parse_scalar(raw: str, *, string_only: bool = False) -> Any:
def _split_top_level(s: str, sep: str) -> List[str]:
"""Split `s` on `sep` ignoring separators inside [] or quotes."""
out, buf, depth, quote = [], [], 0, None
escaped = False
for ch in s:
if quote:
buf.append(ch)
if ch == quote:
if escaped:
escaped = False
elif ch == "\\" and quote == '"':
escaped = True
elif ch == quote:
quote = None
continue
if ch in ("'", '"'):