PDA

View Full Version : QTextEdit produces incorrect html



ccf_h
7th February 2006, 22:21
Hi,
is it to be considered a bug for the Trollteck issue tracker, if the QTextEdit widget in Qt4.1 produces not end tags </li> when making unnumbered lists, or is it a feature? As far as I can see most other closing tags are provided. I find it annoying because it prevents you from easily parsing the html it produces with a xml parser if there are some closing tags missing.:(
Ah, I forgot to mention taht this phenomenon can be easily verified by using the editor coming with the demos ([QT_DIR/demos/textedit).

wysota
7th February 2006, 23:35
QTextEdit produces HTML output, not XHTML. And with HTML ommiting ending tags for <li> is valid.

yop
7th February 2006, 23:39
I find it annoying because it prevents you from easily parsing the html it produces with a xml parser if there are some closing tags missing.:(You are right about this one :(

wysota
8th February 2006, 10:24
You can use external tools like HTML tidy to cleanup the code or make your own tidier. Or subclass QTextEdit and change it :)

ccf_h
8th February 2006, 13:22
Or subclass QTextEdit and change it :)
Isn't it rather QTextDocument that should be subclassed in that case?

wysota
8th February 2006, 16:18
It's your call. Both will work, I guess.