Results 1 to 2 of 2

Thread: Obtaining clean (x)html from QTextEdit

  1. #1
    Join Date
    Jan 2006
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Obtaining clean (x)html from QTextEdit

    Hi,
    I need to get clean simple xhtml from QTextEdit. It's not a problem that QTextEdit supports only a part of the html language set but e.g. the paragraph should be only <p> and </p> instead of all the stuff QTextEdit adds. What comes to my mind is either trying to write a XSLT stylesheet and feed the output of a QTextEdit to a XSLT processor, or to kind of using QTextEdit's API, but this would be difficult and require writing a parser I suppose.
    Any comments or ideas?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Obtaining clean (x)html from QTextEdit

    You can clean the output using a hand-written parser based on regular expressions. For example trying to match "<p.+>" and replacing it with "<p>".

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.