base64 images
JodliDev opened this issue · 3 comments
JodliDev commented
Hello. Thank you very much for this library! It makes handling HTML so much easier!
One question: Is there any chance that it will get base64-image support? Or could you give me some pointers on how to add an according tag-handling system?
When looking through the source, I noticed that this
let regex = try NSRegularExpression(pattern: "data:image/.+;base64,(.+)")
let result = regex.firstMatch(in: url, options: [], range: NSRange(url.startIndex..., in: url))
let nsString = url as NSString
let data = Data(base64Encoded: nsString.substring(with: result!.range(at: 1)), options: .ignoreUnknownCharacters)
return UIImage(data: data!)
But I cannot figure out where.
I guess I would have to import ZNSTextAttachment and then replicate your code. But I could use some pointers on how to utitilize the ZHTMLParserBuilder.add
-method for that
Thanks a lot! :)
zhgchgli0718 commented
will research and implement
JodliDev commented
Thank you for your hard work! :)
zhgchgli0718 commented
In the latest version 1.8.0, the issues have been addressed.
Thank you for your patience.