feat: 建立统一语义文档模型
This commit is contained in:
@@ -32,6 +32,14 @@ const answer = 42;
|
||||
expect(result.bodyHtml).toContain("hljs-keyword");
|
||||
expect(result.bodyHtml).toContain("footnote");
|
||||
expect(result.metadata.title).toBe("示例文档");
|
||||
expect(result.semanticDocument).toEqual({
|
||||
schemaVersion: 1,
|
||||
titlePolicy: {
|
||||
metadataTitle: "suppress",
|
||||
firstBodyHeading: "keep"
|
||||
},
|
||||
regions: []
|
||||
});
|
||||
expect(result.features).toEqual(
|
||||
expect.arrayContaining(["code", "table", "task-list", "footnote"])
|
||||
);
|
||||
@@ -152,6 +160,8 @@ document:
|
||||
expect(result.articleHtml).toContain(
|
||||
'<footer class="doc-edition">'
|
||||
);
|
||||
expect(result.semanticDocument.profile).toBe("official");
|
||||
expect(result.semanticDocument.regions).toHaveLength(2);
|
||||
expect(result.bodyHtml).not.toContain("doc-masthead");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user