Skip to content
Attribute string from HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
HTMLAttributor.xcodeproj
HTMLAttributor
HTMLAttributorTests
HTMLPlayground.playground
.gitignore
.travis.yml
LICENSE
Makefile
README.md

README.md

hattr - parse HTML

Build Status

The hattr iOS package provides a naïve HTML parser to efficiently transform HTML into attributed strings.

Goals

  • No dependencies except UIKit
  • Offloadable from main thread
  • Simple and fast

50X faster than NSAttributedString.init(data:options:documentAttributes:)

At least 50X less correct.

Example

import HTMLAttributor

let hattr = HTMLAttributor()
let tree = try! hattr.parse(html)
let attributedText = try! hattr.attributedString(tree)

Find a runnable example in HTMLPlayground.playground.

License

MIT License

You can’t perform that action at this time.