RichTextElement.elements
items are never promoted to a proper Python object type
#1468
Closed
1 task done
Milestone
Using the rich text editor widget with the following content:
gets you an unordered list, which upon a
view_submission
event gets posted into the state values as:JSON representation of state value
which can then be converted into an object like so:
which is all well and good... But the child elements of the encountered
RichTextElement
subclass are not converted to the equivalent Python class, and always remain as a dict, effectively looking like the parsing "gave up" at a certain depth (which isn't strictly true):As far as I can tell, this is because the
RichTextListElement
,RichTextPreformattedElement
,RichTextQuoteElement
andRichTextSectionElement
never themselves do any parsing, as all of them are defined using:instead of something like:
The latter of which would at least make it so that:
That still leaves some child elements unpromoted, because there's nothing which converts
{'type': 'text', 'text': 'a'}
to aRichTextElementParts.Text
etc, but that feels like a somewhat separate issue.Category
The text was updated successfully, but these errors were encountered: