From 2b0e23f90ef48ec646a65a0d7f9eb110723fecee Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 9 Nov 2026 08:09:59 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20stability=20round=202:=201=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20key=20the?= =?UTF-8?q?=20cases=20by=20url=20too,=20so=20the=20data=20attribute=20is?= =?UTF-8?q?=20read?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/json-text.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/json-text.test.ts b/src/json-text.test.ts index f39421d..2f56fe0 100644 --- a/src/json-text.test.ts +++ b/src/json-text.test.ts @@ -91,7 +91,7 @@ test('accepts exactly the text JSON.parse accepts', () => { }) // V8 from 13.6 reads an escaped key as one it read before; priming it as the bug report does shows a reader that calls JSON.parse. -const keys = { '\b': 1, '\f': 2 } +const keys = { '\b': 1, '\f': 2, url: 'x' } const readers: [string, (document: AdfDocument) => Result, (text: string) => Result][] = [ ['lossless markdown', adfToLosslessMarkdown, losslessMarkdownToAdf], ['HTML', adfToHtml, htmlToAdf], @@ -101,7 +101,7 @@ const documents: [string, AdfNode][] = [ ['an unknown block', { attrs: { keys }, type: 'unknownBlock' }], ['an unknown inline node', paragraphOf({ attrs: { keys }, type: 'unknownInline' })], ['extension parameters', { attrs: { extensionKey: 'toc', extensionType: 'x', parameters: keys }, type: 'extension' }], - ['an inline card', paragraphOf({ attrs: { data: keys, url: 'https://example.com' }, type: 'inlineCard' })], + ['an inline card', paragraphOf({ attrs: { data: keys }, type: 'inlineCard' })], ] for (const [format, write, read] of readers) { @@ -110,8 +110,8 @@ for (const [format, write, read] of readers) { const document: AdfDocument = { content: [node], type: 'doc', version: 1 } const written = write(document) assert.ok(written.ok) - JSON.parse('{"\\b":1,"\\f":2}') - JSON.parse('{"\\b":3,"\\\\":4}') + JSON.parse('{"\\b":1,"\\f":2,"url":"x"}') + JSON.parse('{"\\b":3,"\\\\":4,"url":"x"}') assert.deepEqual(read(written.value), { ok: true, value: document }) }) }