目录
目录README.md

hattr - parse HTML

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.

Install

📦 Add https://github.com/michaelnisi/hattr to your package dependencies.

License

MIT License

关于
113.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号