KTextToHTML

KTextToHTML Namespace Reference

Typedefs

typedef QFlags< OptionOptions
 

Enumerations

enum  Option {
  PreserveSpaces = 1 << 1 , ReplaceSmileys = 1 << 2 , IgnoreUrls = 1 << 3 , HighlightText = 1 << 4 ,
  ConvertPhoneNumbers = 1 << 5
}
 

Functions

KCOREADDONS_EXPORT QString convertToHtml (const QString &plainText, const KTextToHTML::Options &options, int maxUrlLen=4096, int maxAddressLen=255)
 

Detailed Description

Typedef Documentation

◆ Options

Stores a combination of Option values.

Definition at line 59 of file ktexttohtml.h.

Enumeration Type Documentation

◆ Option

See also
Options
Since
5.5.0
Enumerator
PreserveSpaces 

Preserve white-space formatting of the text.

ReplaceSmileys 

Replace text emoticons smileys by emoticons images.

Note
This option works only when KEmoticons framework is available at runtime, and requires QGuiApplication, otherwise the flag is simply ignored.
IgnoreUrls 

Don't parse and replace any URLs.

HighlightText 

Interpret text highlighting markup, like bold, underline and /italic/, and wrap them in corresponding HTML entities.

ConvertPhoneNumbers 

Replace phone numbers with tel: links.

Since
5.56.0

Definition at line 24 of file ktexttohtml.h.

Function Documentation

◆ convertToHtml()

QString KTextToHTML::convertToHtml ( const QString & plainText,
const KTextToHTML::Options & options,
int maxUrlLen = 4096,
int maxAddressLen = 255 )

Converts plaintext into html.

The following characters are converted to HTML entities: & " < >. Newlines are also preserved.

Parameters
plainTextThe text to be converted into HTML.
optionsThe options to use when processing plainText.
maxUrlLenThe maximum length of permitted URLs. The reason for this limit is that there may be possible security implications in handling URLs of unlimited length.
maxAddressLenThe maximum length of permitted email addresses. The reason for this limit is that there may be possible security implications in handling addresses of unlimited length.
Returns
An HTML version of the text supplied in the 'plainText' parameter, suitable for inclusion in the BODY of an HTML document.
Since
5.5.0

Definition at line 421 of file ktexttohtml.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 10 2024 11:50:42 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.