Fix bug that was incorrectly parsing Twitter Symbols. Fixes #3248

This commit is contained in:
Maurice Parker 2021-08-10 20:07:38 -05:00
parent f5aaad4d16
commit 56abb94901

View File

@ -10,18 +10,18 @@ import Foundation
struct TwitterSymbol: Codable, TwitterEntity {
let name: String?
let text: String?
let indices: [Int]?
enum CodingKeys: String, CodingKey {
case name = "name"
case text = "text"
case indices = "indices"
}
func renderAsHTML() -> String {
var html = String()
if let name = name {
html += "<a href=\"https://twitter.com/search?q=%24\(name)\">$\(name)</a>"
if let text = text {
html += "<a href=\"https://twitter.com/search?q=%24\(text)\">$\(text)</a>"
}
return html
}