fix: judge evidence alt text with asset metadata, not syntax
The parser has no asset catalogue, so it cannot know whether an evidence figure is decorative. Move the empty-alt rejection from parse-time (a syntax error) to publish validation, where the mock treats static evidence assets as decorative: false since the static registry predates the Asset capability. The real rule is that the server judges alt against Asset.decorative.
This commit is contained in:
@@ -514,7 +514,9 @@ function directiveBlock(
|
||||
if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(attributes.key)) {
|
||||
invalid(node, `unsafe evidence key: ${attributes.key}`);
|
||||
}
|
||||
if (!attributes.alt) invalid(node, "evidence alt text is required");
|
||||
// alt 필요 여부는 Asset의 `decorative`에 달려 있어 여기서는 판단할 수
|
||||
// 없다. 빈 alt는 구문 오류가 아니며 publish 검증이 Asset metadata와 함께
|
||||
// 판정한다(설계 §7.7).
|
||||
if (attributes.zoom !== "true" && attributes.zoom !== "false") {
|
||||
invalid(node, "evidence zoom must be true or false");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user