Assigned
Status Update
Comments
vi...@google.com <vi...@google.com> #3
We’ve shared this with our product and engineering teams and will continue to provide updates as more information becomes available.
mr...@gmail.com <mr...@gmail.com> #4
Any luck Facing the same Issue --- The IOS guys do HTML stuff through Attributed Strings they are able to parse each tag correctly into a text label.
a Friend gave me sample like below:
Some Swift version code...
extension UILabel {
func setHtmlFromString(htmlString: String) {
let modifiedFont = String(format:"<span style=\"font-family: '\(self.font.familyName)'; font-size: \(self.font!.pointSize)\">%@</span>", htmlString)
let attrStr = try! NSAttributedString(
data: modifiedFont.data(using: .unicode, allowLossyConversion: true)!,
options: [.documentType: NSAttributedString.DocumentType.html, .characterEncoding:String.Encoding.utf8.rawValue],
documentAttributes: nil)
self.attributedText = attrStr
}
}
When I try to use Html.fromHtml(text,flag)
it skip tables tag and other styled stuff...
If Attributed strings can be a solution should we try that instead?
a Friend gave me sample like below:
Some Swift version code...
extension UILabel {
func setHtmlFromString(htmlString: String) {
let modifiedFont = String(format:"<span style=\"font-family: '\(self.font.familyName)'; font-size: \(self.font!.pointSize)\">%@</span>", htmlString)
let attrStr = try! NSAttributedString(
data: modifiedFont.data(using: .unicode, allowLossyConversion: true)!,
options: [.documentType: NSAttributedString.DocumentType.html, .characterEncoding:String.Encoding.utf8.rawValue],
documentAttributes: nil)
self.attributedText = attrStr
}
}
When I try to use Html.fromHtml(text,flag)
it skip tables tag and other styled stuff...
If Attributed strings can be a solution should we try that instead?
mi...@gmail.com <mi...@gmail.com> #5
How about you get this shit of my phone please . Never asked for it never agreed about it . I don't want this. Please explain how it all got here and by who?
mi...@gmail.com <mi...@gmail.com> #6
What is this. I don't do this. I use my phone for the simple things in life. Don't want to share ,please stop this.. explain what it even is. Get rid of it please. First time I'm seeing all of this information
m....@anfe.ma <m....@anfe.ma> #7
So this issue has been around since at least 2010: https://issuetracker.google.com/issues/36917758
Seriously, how difficult can it be?
Seriously, how difficult can it be?
je...@hotmail.com <je...@hotmail.com> #8
Any update on this? Running into iOS vs Android parity issues when trying to parse html strings from backend into formattable text. As mentioned before, iOS parses all quite while, but not Android's `fromHtml()`. Hard to know what to tell backend team when we are not sure which tags are supported and which are not.
Also, can you please handle cases of `<span style="font-weight"> ? Thanks
Also, can you please handle cases of `<span style="font-weight"> ? Thanks
ga...@bookmyshow.com <ga...@bookmyshow.com> #9
These are tags that can be specified in `<string>` in the resources folder, but I think should work other than that as well
Not sure if this is the complete list!
Description
These classes convert HTML to and from
Spanned
objects. However, their JavaDocs does not document:Spanned
character styles are supportedThe closest is this statement in the
Html
documentation: "Not all HTML tags are supported." While that is nice, it is not especially useful. The documentation forms the contract between the developers that created these classes and the developers using these classes, so everybody knows what is expected to be supported today and in the future.