Open Instance Methodscinfu.swiftsoup 2.8.7SwiftSoup
attr(_:_:)
TextNode.swift:201override func attr(_ attributeKey: [UInt8], _ attributeValue: [UInt8]) throws -> Node
override func attr(_ attributeKey: [UInt8], _ attributeValue: [UInt8]) throws -> Node
import SwiftSoup
class TextNode
A text node.
@frozen struct UInt8
An 8-bit unsigned integer value type.
class Node
@discardableResult func attr(_ attributeKey: [UInt8], _ attributeValue: [UInt8]) throws -> Node
Set an attribute (key=value). If the attribute already exists, it is replaced.
convenience init(_ text: String, _ baseUri: String?)
init(_ text: [UInt8], _ baseUri: [UInt8]?)
Create a new TextNode representing the supplied (unencoded) text).
static func createFromEncoded(_ encodedText: String, _ baseUri: String) throws -> TextNode
Create a new TextNode from HTML encoded (aka escaped) data.
static func lastCharIsWhitespace(_ sb: StringBuilder) -> Bool
static func normaliseWhitespace(_ text: String) -> String
static func normaliseWhitespace(_ text: [UInt8]) -> String
static func stripLeadingWhitespace(_ text: String) -> String
override func absUrl(_ attributeKey: String) throws -> String
override func absUrl<T>(_ attributeKey: T) throws -> [UInt8] where T : Collection, T.Element == UInt8
override func attr(_ attributeKey: String) throws -> String
override func attr(_ attributeKey: [UInt8]) throws -> [UInt8]
override func attr(_ attributeKey: String, _ attributeValue: String) throws -> Node
override func copy(clone: Node, parent: Node?) -> Node
override func copy(parent: Node?) -> Node
override func copy(with zone: NSZone? = nil) -> Any
override func getAttributes() -> Attributes
func getWholeText() -> String
Get the (unencoded) text of this text node, including any newlines and spaces present in the original.
func getWholeTextUTF8() -> [UInt8]
override func hasAttr(_ attributeKey: String) -> Bool
func isBlank() -> Bool
Test if this text node is blank – that is, empty or only whitespace (including newlines).
override func nodeName() -> String
override func nodeNameUTF8() -> [UInt8]
override func removeAttr(_ attributeKey: String) throws -> Node
override func removeAttr(_ attributeKey: [UInt8]) throws -> Node
func splitText(_ offset: Int) throws -> TextNode
Split this text node into two nodes at the specified string offset. After splitting, this node will contain the original text up to the offset, and will have a new text node sibling containing the text after the offset.
func splitText(utf8Offset: Int) throws -> TextNode
func text() -> String
Get the text content of this text node.
@discardableResult func text(_ text: String) -> TextNode
Set the text content of this text node.