On Tue, Aug 7, 2012 at 11:35 PM, 程梁 <[email protected]> wrote:
> Thanks! I saw this example before. There is the same problem as I met. > If you clear editing area and type something, you will got some HTML > code like: > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " > http://www.w3.org/TR/html4/strict.dtd"><html><head> > > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> > > <title>HTML Editor Demo</title> > > </head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; > -webkit-line-break: after-white-space; ">hey</body></html> > > in which I just write hey and I want to get > > <p>hey</p> > > <snip> If that's the case, I'd just do a simple javascript function to HTML-ize everything underneath body. Not sure if this works in WebKit, but a javascript call like: document.body.innerHTML() should give you just the content of the body. You could wrap it in <p> tags if no tags found in the HTML (e.g. just one long string.)
_______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest
