Test the HTML generated by Quill in a browser

ⅰ亾dé卋堺 提交于 2020-06-17 12:58:42

问题


I have published two questions related to my problem, first of which was closed, but I still do not have the answer to my problem.

My first question that was closed:

Convert HTML to PDF using PrimceFaces 7.0 (or higher) Text Editor and Quill

My second question was answered here:

The Quill publicly available css

Based on the answer of my second question I dare to once again ask my first question: How could I generate nice, production-ready PDF files from the HTML produced by the Quill HTML editor?

The answer to my second question suggests that I must deliberately modify, or process, the HTML generated by it, in order to adjust its styling information.

If this is so, it makes my task very difficult and error prone.

If I apply the changes to the HTML suggested in the answer to my second question, I got the styled text, but the rest of the text seems strange, see below:

HTML after applying the change suggested in the second answer:

<html> <head> <link rel="stylesheet" href="http://cdn.quilljs.com/1.3.6/quill.snow.css"/> </head> <body> <p> <div class="ql-editor"> <span class="ql-size-large">Hello, dear friends!</span> </div> </p> <p> <br /> </p> <p>I am glad to see ALL of you <span style="background-color:rgb( 230 , 0 , 0 )">today</span> here! </p> </body> </html>

This is the debugger in case of applying the changes in HTML:

In case I apply the suggested style class to the <body> element in my HTML I get this:

<html> <head> <link rel="stylesheet" href="http://cdn.quilljs.com/1.3.6/quill.snow.css"/> </head> <body class="ql-editor"> <p> <span class="ql-size-large">Hello, dear friends!</span> </p> <p> <br /> </p> <p>I am glad to see ALL of you <span style="background-color:rgb( 230 , 0 , 0 )">today</span> here! </p> </body> </html>

which might be technically correct, see below the debugger information:

but is still far away from my initial design in the the Text Editor, see below:

So, the resulted HTML differs from the intended HTML.

来源:https://stackoverflow.com/questions/61888024/test-the-html-generated-by-quill-in-a-browser

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!