KTextToHTML
KTextToHTML Namespace Reference
Typedefs | |
typedef QFlags< Option > | Options |
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
typedef QFlags< Option > KTextToHTML::Options |
Stores a combination of Option values.
Definition at line 59 of file ktexttohtml.h.
Enumeration Type Documentation
◆ Option
enum KTextToHTML::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.
|
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.
|
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
-
plainText The text to be converted into HTML. options The options to use when processing plainText
.maxUrlLen The maximum length of permitted URLs. The reason for this limit is that there may be possible security implications in handling URLs of unlimited length. maxAddressLen The 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 437 of file ktexttohtml.cpp.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 04:01:14 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 04:01:14 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.