Fix bug that was incorrectly parsing Twitter Symbols. Fixes #3248
This commit is contained in:
parent
acccc4f063
commit
b38ee75ba2
|
@ -10,18 +10,18 @@ import Foundation
|
||||||
|
|
||||||
struct TwitterSymbol: Codable, TwitterEntity {
|
struct TwitterSymbol: Codable, TwitterEntity {
|
||||||
|
|
||||||
let name: String?
|
let text: String?
|
||||||
let indices: [Int]?
|
let indices: [Int]?
|
||||||
|
|
||||||
enum CodingKeys: String, CodingKey {
|
enum CodingKeys: String, CodingKey {
|
||||||
case name = "name"
|
case text = "text"
|
||||||
case indices = "indices"
|
case indices = "indices"
|
||||||
}
|
}
|
||||||
|
|
||||||
func renderAsHTML() -> String {
|
func renderAsHTML() -> String {
|
||||||
var html = String()
|
var html = String()
|
||||||
if let name = name {
|
if let text = text {
|
||||||
html += "<a href=\"https://twitter.com/search?q=%24\(name)\">$\(name)</a>"
|
html += "<a href=\"https://twitter.com/search?q=%24\(text)\">$\(text)</a>"
|
||||||
}
|
}
|
||||||
return html
|
return html
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue