Fixes #922
parent
50d80d5fef
commit
21b04a17fe
|
@ -5,6 +5,8 @@ import {
|
||||||
replaceNodesMatchingAsync,
|
replaceNodesMatchingAsync,
|
||||||
} from "./tree.ts";
|
} from "./tree.ts";
|
||||||
|
|
||||||
|
import { cleanupJSON } from "$sb/lib/json.ts";
|
||||||
|
|
||||||
import { system, YAML } from "../syscalls.ts";
|
import { system, YAML } from "../syscalls.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +33,7 @@ export async function extractAttributes(
|
||||||
const name = nameNode.children![0].text!;
|
const name = nameNode.children![0].text!;
|
||||||
const val = valueNode.children![0].text!;
|
const val = valueNode.children![0].text!;
|
||||||
try {
|
try {
|
||||||
attributes[name] = await YAML.parse(val);
|
attributes[name] = cleanupJSON(await YAML.parse(val));
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.error("Error parsing attribute value as YAML", val, e);
|
console.error("Error parsing attribute value as YAML", val, e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue