3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-21 07:32:58 +01:00

Refuse a markdown input that is not a string with not-a-string

This commit is contained in:
2026-10-05 09:19:19 +02:00
committed by Lillem4n
parent 5834ac0c7d
commit 2c4fadbd8b
9 changed files with 29 additions and 17 deletions
+4
View File
@@ -2,6 +2,10 @@
## Unreleased
- **Breaking:** `markdownToAdf` and `plainMarkdownToAdf` refuse a value that is not a string with
the new code `not-a-string`, at position `{ line: 1, offset: 0 }`. Before, `null` and `undefined`
threw a `TypeError` and a number read as an empty document. A `switch` over `ConvertErrorCode`
naming every code needs the new case.
- **Breaking:** an attribute value that is not a plain object, array or JSON primitive, such as a
`Date`, `Map`, typed array or class instance, makes `isAdfDocument` return `false` and the
converters refuse it as `not-an-adf-document`. Before, the converters wrote it as `{}` or its own