Skip to content

Conversion of spans leads to invalid blocks and drops images #21

@pbauer

Description

@pbauer

Source is an empty span:

<p><span></span></p>

Result:

{'@type': 'slate',
 'plaintext': '',
 'value': [{'children': [{'children': [], 'type': 'span'}], 'type': 'p'}]}

Problem:
On editing it raises Error: Cannot get the start point in the node at path [0] because it has no start text node.

Source is a span with a image

<p><span><img src='image.jpeg'></span></p>

Result (same as above):

{'@type': 'slate',
 'plaintext': '',
 'value': [{'children': [{'children': [], 'type': 'span'}], 'type': 'p'}]}

Problem:
The image is dropped. On editing it again raises Error: Cannot get the start point in the node at path [0] because it has no start text node.

Source is a span with image and text

<p><span><img src='image.jpeg'>text</span></p>

Result

{'@type': 'slate',
 'plaintext': 'text',
 'value': [{'children': [{'children': [{'text': 'text'}], 'type': 'span'}], 'type': 'p'}]}

Problem:
The image is dropped, the block is valid

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions