3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 14:45:44 +01:00

Ship htmlToAdf: read back exactly the HTML adfToHtml writes, a carry element from its data-adf alone, any other HTML refused

This commit is contained in:
2026-10-26 21:47:30 +01:00
committed by Lillem4n
parent 905b039866
commit 51e37f68df
26 changed files with 880 additions and 74 deletions
+2
View File
@@ -133,6 +133,8 @@ for (const [index, { json, name }] of corpus.realPayloads.entries()) {
assert.ok(result.parsed.ok, `it did not parse back — ${refusal(result.parsed)}`)
assert.deepEqual(revived(result.parsed.value), JSON.parse(json))
assert.deepEqual(result.html, adfToHtml(JSON.parse(json)), 'it wrote other HTML than Node wrote')
assert.ok(result.htmlParsed.ok, `its HTML did not read back — ${refusal(result.htmlParsed)}`)
assert.deepEqual(revived(result.htmlParsed.value), JSON.parse(json))
})
}