-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with combination of text and list/blockquote/code-block #22
Comments
@scolnet List and blockquotes are block-level attributes and must be applied on an op with a [
{
"insert": "text\nbullet 1"
},
{
"insert": "\n",
"attributes": {
"list": "ordered"
}
},
{
"insert": "bullet 2"
},
{
"insert": "\n",
"attributes": {
"list": "ordered"
}
},
{
"insert": "bullet 3"
},
{
"insert": "\n",
"attributes": {
"list": "ordered"
}
},
{
"insert": "\n"
}
] Giving html of:
Your blockquote would be: [
{
"insert": "text\nusing quote"
},
{
"insert": "\n",
"attributes": {
"blockquote": true
}
}
] Giving html of:
You can try out formatting in the example app, or here https://quilljs.com/docs/delta#playground. Also see this issue slab/quill#2196, which is someone else who had the same misunderstanding in the quilljs project. |
Thanks a lot for your quick answer @dsyrstad The delta I wrote here is directly generated by using the flutter_quill editor. |
Hmmm... The examples I gave you are from the example app in the repo, which also uses flutter_quill. It looks like just your first "bullet1" bullet is the problem, the rest seem to have generated fine. |
I test with flutter_quill 9.4.6 on Web version (canvaskit) with json encoded to see better
generated html Agree with you about the bullet1 I see an issue of the same type in the repo #1940 |
@scolnet Thanks for researching that. The example app is using flutter_quill 8.6.4, which may be the difference. Anyway, the Quill Delta you got from it is not correct, as far as I can tell. |
Hello team,
Thanks for your very useful project !
There is a problem in the html conversion when I try to convert this simple delta :
[{insert: text }, {insert: bullet 1 , attributes: {list: ordered}}, {insert: bullet 2}, {insert: , attributes: {list: ordered}}, {insert: bullet 3}, {insert: , attributes: {list: ordered}}, {insert: bullet 4}, {insert: , attributes: {list: ordered}}]
You get this :
<p>text</p><ol><li><br/></li><li><br/></li><li>bullet 2</li><li>bullet 3</li><li>bullet 4</li></ol>
-> add one extra li tag and fill with br
Same type of problem if you remplace the list by blockquote or code-block
For exemple with delta
[{insert: text }, {insert: using quote , attributes: {blockquote: true}}]
you get this
<p>text</p><blockquote style="border-left: 4px solid #ccc;padding-left: 16px"><br/><br/></blockquote>
If you start by the list and add text after, it's ok.
Do you have an idea ?
Thanks for your help
The text was updated successfully, but these errors were encountered: