SwiftSoup
import SwiftSoup
Module information
- Declarations
- 1217
- Symbols
- 1413
import SwiftSoup
func clean(_ bodyHtml: String, _ whitelist: Whitelist) throws -> String?
Get safe HTML from untrusted input HTML, by parsing input HTML and filtering it through a white-list of permitted tags and attributes.
func clean(_ bodyHtml: String, _ baseUri: String, _ whitelist: Whitelist) throws -> String?
Get safe HTML from untrusted input HTML, by parsing input HTML and filtering it through a white-list of permitted tags and attributes.
func clean(_ bodyHtml: String, _ baseUri: String, _ whitelist: Whitelist, _ outputSettings: OutputSettings) throws -> String?
func isValid(_ bodyHtml: String, _ whitelist: Whitelist) throws -> Bool
Test if the input HTML has only tags and attributes allowed by the Whitelist. Useful for form validation. The input HTML should still be run through the cleaner to set up enforced attributes, and to tidy the output.
func parse(_ html: String) throws -> Document
Parse HTML into a Document. As no base URI is specified, absolute URL detection relies on the HTML including a {@code
func parse(_ html: String, _ baseUri: String) throws -> Document
Parse HTML into a Document. The parser will make a sensible, balanced document tree out of any HTML.
func parse(_ html: String, _ baseUri: String, _ parser: Parser) throws -> Document
Parse HTML into a Document, using the provided Parser. You can provide an alternate parser, such as a simple XML (non-HTML) parser.
func parseBodyFragment(_ bodyHtml: String) throws -> Document
Parse a fragment of HTML, with the assumption that it forms the {@code body} of the HTML.
func parseBodyFragment(_ bodyHtml: String, _ baseUri: String) throws -> Document
Parse a fragment of HTML, with the assumption that it forms the {@code body} of the HTML.
func testBit(_ mask: (UInt64, UInt64, UInt64, UInt64), _ b: UInt8) -> Bool
func + <T, S>(lhs: OrderedSet<T>, rhs: S) -> OrderedSet<T> where T : Hashable, T == S.Element, S : Sequence
func + (lhs: StringBuilder, rhs: StringBuilder) -> StringBuilder
Create a StringBuilder by concatenating the values of two StringBuilders
func += <T, S>(lhs: inout OrderedSet<T>, rhs: S) where T : Hashable, T == S.Element, S : Sequence
func += (lhs: StringBuilder, rhs: String)
Append a String to a StringBuilder using operator syntax
func += <T>(lhs: StringBuilder, rhs: T) where T : CustomStringConvertible
Append a Printable to a StringBuilder using operator syntax
func - <T, S>(lhs: OrderedSet<T>, rhs: S) -> OrderedSet<T> where T : Hashable, T == S.Element, S : Sequence
func -= <T, S>(lhs: inout OrderedSet<T>, rhs: S) where T : Hashable, T == S.Element, S : Sequence
func == <T>(lhs: OrderedSet<T>, rhs: OrderedSet<T>) -> Bool where T : Hashable
func == (lhs: TypedValue, rhs: TypedValue) -> Bool
protocol NodeVisitor
Node visitor interface. Provide an implementing class to {@link NodeTraversor} to iterate through nodes.
class Attribute
class AttributeKey
class AttributeValue
class Attributes
The attributes of an Element.
class BooleanAttribute
A boolean attribute that is written out without any value.
final class CharacterReader
class Cleaner
class Collector
Collects a list of elements that match the supplied criteria.
class CombiningEvaluator
Base combining (and, or) evaluator.
class Comment
A comment node.
class CssSelector
class DataNode
A data node, for contents of style, script tags etc, where contents should not show in text().
class Document
class DocumentType
A {@code <!DOCTYPE>} node.
class Element
class Elements
struct ElementsIterator
class Entities
HTML entities, and escape routines. Source: W3C HTML named character references.
class Evaluator
Evaluates that an element matches the selector.
enum Exception
enum ExceptionType
class FormElement
A HTML Form Element provides ready access to the form fields/controls that are associated with it. It also allows a form to easily be submitted.
class Matcher
class Node
class NodeTraversor
class OrderedSet<T> where T : Hashable
An ordered, unique collection of objects.
struct OrderedSetGenerator<T> where T : Hashable
class OutputSettings
class ParseError
A Parse Error records an error in the input HTML that occurs in either the tokenisation or the tree building phase.
class ParseErrorList
class ParseSettings
class Parser
struct ParsingStrings
struct Pattern
class Protocol
class QueryParser
Parses a CSS selector into an Evaluator tree.
class SimpleDictionary<KeyType, ValueType> where KeyType : Hashable
class StringBuilder
Supports creation of a String from pieces Based on https://gist.github.com/kristopherjohnson/1fc55e811d944a430289
class StringUtil
A minimal String utility class. Designed for internal SwiftSoup use only.
class StructuralEvaluator
Base structural evaluator.
class Tag
class TagName
class TextNode
A text node.
class Token
class TokenQueue
class TokeniserStateVars
class TreeBuilder
class TypedValue
enum UTF8ArraySlices
enum UTF8Arrays
struct Validate
class Whitelist
class XmlDeclaration
An XML Declaration.
class XmlTreeBuilder
Use the {@code XmlTreeBuilder} when you want to parse XML without any of the HTML DOM rules being applied to the document.