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

Ignore tags from user input #152

Closed LaCost765 closed 1 year ago

LaCost765 commented 2 years ago

Hello. I have a case when I apply style for user input text like this: "Hello mr \(userInput)\!". It can be clearly seen, that I want make bold text from user input. But if user input contains < and something else after that sign, .style method detect this like tag too and \\ breaks down. So, is it possible to ignore tags from user input in that case? TY in advance P.S. Sorry for my terrible English :)

psharanda commented 1 year ago

Hi! You should escape the user input first e.g. replace > with &gt; etc