You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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();
The text was updated successfully, but these errors were encountered:
I save content to my database with tiptap editor, the output json from the editor is this:
However, when this is passed into tiptap-php with
setContent
and thengetHTML
, theol
element has no order attribute. If I modify the json above to haveorder
instead ofstart
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:
Correct:
The text was updated successfully, but these errors were encountered: