Document markup and improve choice tags

This commit is contained in:
2026-05-17 15:52:41 +02:00
parent c2fb27b6b8
commit 2c54498ee2
52 changed files with 3485 additions and 377 deletions
+8
View File
@@ -23,6 +23,14 @@ export function parseTag(raw: string): StoryTag | null {
return tag;
}
const colonMatch = text.match(/^([A-Za-z][\w-]*)\s*:\s*(.*?)\s*(?:\(([^)]*)\))?$/);
if (colonMatch) {
const tag: StoryTag = { key: normalizeKey(colonMatch[1]) };
tag.value = colonMatch[2].trim();
if (typeof colonMatch[3] !== 'undefined') tag.param = colonMatch[3].trim();
return tag;
}
const bareMatch = text.match(/^[A-Za-z][\w-]*$/);
if (bareMatch) {
return { key: normalizeKey(text) };