FormatPostTextTag
struct FormatPostTextTag : UnsafeUnescapedLeafTag
Runs the element sanitizer on the given string, converts Jocomoji (specific string tags with the form :tag:) into inline images, and then converts substrings of the forum “@username” and “#hashtag” into links.
Usage: #formatTwarrtText(String) -> String Usage: #formatPostText(String) -> String Usage: #formatFezText(String) -> String Usage: #formatSeamailText(String) -> String
-
Declaration
Swift
static var nameRefStartCharacterSet: CharacterSet { get }
-
Declaration
Swift
func render(_ ctx: LeafContext) throws -> LeafData
-
Process a set of regex matches and substitute appropriate content in a return HTML string.
Pass by ref can kinda be voodoo. https://stackoverflow.com/questions/27364117/is-swift-pass-by-value-or-pass-by-reference
Declaration
Swift
private func processUrlMatches(string: inout String, matches: [NSTextCheckingResult])
Parameters
string
Reference to the Leaf string that is the HTML content to return to the user.
matches
Array of regex matching ranges.
Return Value
void
-
Declaration
Swift
enum Usage
-
Declaration
Swift
let usage: Usage
-
Declaration
Swift
let genericUrlRegex: NSRegularExpression
-
Declaration
Swift
init(_ forUsage: Usage) throws