Closed tremby closed 1 year ago
Yep, we probably need to clean this up, as all nodes use the same interface, and therefore have shared attributes - some of which aren't applicable.
It's odd then that paragraphs within blockquotes have "text", whereas paragraphs not inside blockquotes do not.
This could also be made less confusing with documentation, if changing the structure would be a pain. For example the "text" property could have docs saying something like "only applies to nodes of these types: ... and will otherwise always be empty".
Yep, we're largely locked-in to the schema structure (there are ways around it but just makes everything more complex), so maybe we just need to normalise things a little better. But agreed on some clearer docs explaining the difference (I'm still on the fence about leaving as-is or improving, which would be why there's none yet)
Fixed in 2.1.0
Description
I've noticed that certain data types always come back with
"text": ""
, but I can't see any way that they would be populated.I could be missing something, but I think all possible content would be in the
content
key. Maybetext
is vestigial in these cases? If so, it's confusing to the developer and would be better removed.I've seen it on
listItem
(any content will be in thecontent
property)paragraph
when it's nested in ablockquote
(any content will be in thecontent
property)hardBreak
(can't have content)Additional info
Additional context