psharanda / Atributika

Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.
MIT License
1.45k stars 155 forks source link

Font not applied to strong tag inside paragraph #88

Closed mariusgab closed 4 years ago

mariusgab commented 5 years ago

For example I have a string "<p>some string... <strong> string</strong></p>" and I want to apply different fonts to the paragraph and strong strings. But the paragraph font also applies to the strong tag.

let p = Style("p").font(UIFont.init(name: "HelveticaNeue", size: 20)!)
let strong = Style("strong").font(UIFont.init(name: "Copperplate", size: 20)!)
let attr = "<p>some string... <strong> string</strong></p>".(tags: [p,strong]).attributedString

Is there any way to have the strong string have a different font,in the above example the Copperplate font?

psharanda commented 4 years ago

This doesn't seem an issue any more