tiptap-php
tiptap-php copied to clipboard
Ordered List incompatible with Tiptap JS
I save content to my database with tiptap editor, the output json from the editor is this:
'{"type":"doc","content":[{"type":"orderedList","attrs":{"start":2},"content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Test text here "}]}]}]}]}';
However, when this is passed into tiptap-php with setContent
and then getHTML
, the ol
element has no order attribute. If I modify the json above to have order
instead of start
it works as expected. I believe this to be a bug in tiptap-php and not tiptap js.
This is re-produceable with the below code:
Incorrect:
$content = '{"type":"doc","content":[{"type":"orderedList","attrs":{"start":2},"content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Test text here "}]}]}]}]}';
echo (new Editor())
->setContent($content)
->getHTML();
Correct:
$content = '{"type":"doc","content":[{"type":"orderedList","attrs":{"order":2},"content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Test text here "}]}]}]}]}';
echo (new Editor())
->setContent($content)
->getHTML();
Hi has there been any update or anyone been able to look into this issue?