fix(yaml/tag): prevent yaml role=tag from being stripped & generalize
data-config
This commit is contained in:
@@ -56,12 +56,16 @@ export function parseBlockAttrs(info: string): BlockAttrs {
|
||||
* Defaults:
|
||||
* - role is set, no explicit as → "none" (strip — it's metadata)
|
||||
* - role=spark-table → "md-table" (render as md-table directive)
|
||||
* - role=tag → "codeblock" (kept for the marked yaml-tag extension)
|
||||
* - no role, no as → "codeblock" (keep as visible code block)
|
||||
*/
|
||||
export function resolveBlockAs(role: string | undefined, as: string | undefined): string {
|
||||
if (as) return as;
|
||||
// spark-table blocks render as md-table by default
|
||||
if (role === "spark-table") return "md-table";
|
||||
// yaml-defined tag blocks must survive stripping so the
|
||||
// code-block-yaml-tag marked extension can render them
|
||||
if (role === "tag") return "codeblock";
|
||||
if (role) return "none";
|
||||
return "codeblock";
|
||||
}
|
||||
Reference in New Issue
Block a user