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
{{ message }}
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.
I'm currently using your awesome library to do a TextDelta to HTML converter on the backend side.
When converting a particular document to lines, I noticed some attributes were lost in translation.
Sample unexpected output
input_textdelta=%TextDelta{ops: [%{insert: "\nTitle 1"},%{attributes: %{header: 1},insert: "\n"},%{insert: "\nTitle 2"},%{attributes: %{header: 1},insert: "\n\n"},%{insert: "\n"}]}TextDelta.lines(input_textdelta)# Outputs:{:ok,[{%TextDelta{ops: []},%{}},{%TextDelta{ops: [%{insert: " Title 1"}]},%{header: 1}},{%TextDelta{ops: []},%{}},{%TextDelta{ops: [%{insert: " Title 2"}]},%{}},# <=== Here, we're missing the attribute `header: 1`{%TextDelta{ops: []},%{}},# <=== Here as well. 🤔 {%TextDelta{ops: []},%{}}]}
As you can see, the %{header: 1} attribute has been lost on Title 2 and the subsequent line. This only seems to happen on the last lines of the document. The rest of the document is properly separated into lines.
What makes me say it's a potential bug is that when comparing with the HTML output of QuillJS, this generates the following HTML:
Hello 👋
I'm currently using your awesome library to do a TextDelta to HTML converter on the backend side.
When converting a particular document to
lines
, I noticed some attributes were lost in translation.Sample unexpected output
As you can see, the
%{header: 1}
attribute has been lost onTitle 2
and the subsequent line. This only seems to happen on the last lines of the document. The rest of the document is properly separated into lines.What makes me say it's a potential bug is that when comparing with the HTML output of QuillJS, this generates the following HTML:
I'll see if I can provide a pull request fixing the issue and thanks again for this awesome library 😻
The text was updated successfully, but these errors were encountered: