feat(markdown): support yaml role=tag info string

Accept yaml role=tag alongside legacy yaml/tag so the block
body gets yaml syntax highlighting, matching the CLI role=
attribute convention. Copy button now emits the role=tag form.
This commit is contained in:
2026-09-03 10:10:06 +08:00
parent f1ddc8fb8e
commit d75df5280f
6 changed files with 83 additions and 22 deletions
+4 -3
View File
@@ -521,7 +521,7 @@ export function createDeckStore(initialSrc: string = ""): DeckStore {
return parts.join("");
};
/** Serialize the deck back to a ```yaml/tag codeblock (round-trips templates). */
/** Serialize the deck back to a yaml codeblock (round-trips templates). */
const generateYamlCode = () => {
const toYamlLayer = (l: LayerConfig) => {
const out: Record<string, unknown> = {};
@@ -560,8 +560,9 @@ export function createDeckStore(initialSrc: string = ""): DeckStore {
lineWidth: -1,
noRefs: true,
});
const fence = "```";
return `${fence}yaml/tag\n${yamlStr}${fence}`;
const fence = "```yaml role=tag";
const backtick = "`";
return `${fence}\n${yamlStr}${backtick.repeat(3)}`;
};
const copyCode = async (fallback?: (code: string) => void) => {