The hattr package provides a simple HTML parser to efficiently transform HTML into attributed strings.
- No dependencies
- Offloadable from main thread
- Keeping it simple
import HTMLAttributor
// html is a string of HTML
let worker = HTMLAttributor()
let tree = try! worker.parse(html)
let text = try! worker.attributedString(tree)
Find a runnable example in HTMLPlayground.playground
.