[KDEREVIEW] Rich text markup builders

Stephen Kelly steveire at gmail.com
Wed Nov 5 19:16:20 GMT 2008


Hi,

Some kdepim applications and libraries require cleaner html from a
qtextdocument than provided by its toHtml method. The qt html contains a
sea of span tags and styles. This causes hassle when adding a rich text
signature to a message in kmail for example.

I wrote some classes to build cleaner html and also allow writing a builder
class for other forms of output such as BBCode, MediaWiki markup and a form
of plain text markup common in emails.

There are unit tests for html output, and I'm creating some for the plain
markup output too.


The code is here:

http://websvn.kde.org/trunk/kdereview/richtextbuilders

More history here:

http://thread.gmane.org/gmane.comp.kde.devel.pim/22651
(The email specific classes have been discarded.)

apidox:
http://api.kde.org/playground-api/pim-apidocs/richtextbuilders/html/annotated.html

Here's a rundown:

KMarkupDirector - 'reads' a QTextDocument and instructs an abstract builder
object to create its markup. Move into kdelibs/kdeui.

KAbstractMarkupBuilder - defines interface of a builder. Move into
kdelibs/kdeui

KHTMLBuilder - Builds HTML output. Move into kdelibs/kdeui
KPlainTextMarkupBuilder - Builds plain text markup. Move into kdelibs/kdeui
BBCodeBuilder, MediaWikiBuilder - Move into
kdelibs/kdeui/tests/krichtexteditor as examples only for now.
KRichTextEditor - Merge back into kdelibs/kdeui/test/krichtexteditor
/tests/htmlbuildertests - Move into kdelibs/kdeui/tests









More information about the kde-core-devel mailing list