ZMarkupParser is a pure-Swift library that helps you convert HTML strings into NSAttributedString with customized styles and tags.
<s>
/<em>
/<pre>
/<blockquote>
/<code>
HTML tags.tag is empty or is a self-closing tag. #16
<h1>
/<h2>
/<h3>
/<h4>
/<h5>
/<h6>
to correspond with their respective sizes.*1*1 you can modify them in the builder during runtime by using ZHTMLParserBuilder.initWithDefault().add(H1_HTMLTagName(), withCustomStyle: MarkupStyle(font: MarkupStyleFont(size: 18, weight: .style(.semibold)))).build()
.
Thanks to @makhocheung for noticing that I missed supporting H tags. #12
MarkupStylePolicy
, you can specify in ZHTMLParserBuilder to decide HTML Style Attribute merge policy<table>
format<img>
/<tr>
/<td>
/<tr>
officially 🎉, you can use ZMarkupPaser render image tag currently!#7 , #5 , #6