HTMLHelper
class HTMLHelper
Undocumented
-
This function takes a HTML string and returns the plain text content
Declaration
Swift
static func getPlainText(html: String) -> String
-
This function takes a HTML string and returns an NSAttributedString maintaining only basic formatting This MUST be run on the *main thread *
Declaration
Swift
static func getSimpleAttributedString(html: String) -> NSAttributedString
-
This function validates HTML and returns a NSAttributedString This MUST be run on the *main thread *
Declaration
Swift
static func getAttributedString(html: String) -> NSAttributedString?
-
This function validates HTML and returns a valid HTML string Maintains a limited set of elements
Declaration
Swift
static func cleanHTMLBasic(_ html: String) -> String?
-
This function validates HTML and returns a valid HTML string Maintains structural elements (eg. div)
Declaration
Swift
static func cleanHTMLMaintainingStructuralElements(_ html: String) -> String?