mirror of https://github.com/zedeus/nitter
Escape special characters in long tweets
This commit is contained in:
parent
95893eedaa
commit
fa12be41d0
|
@ -1,5 +1,5 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
import std/[strutils, times, macros, htmlgen, options, algorithm, re]
|
||||
import std/[strutils, times, macros, htmlgen, options, algorithm, re, xmltree]
|
||||
import std/unicode except strip
|
||||
import packedjson
|
||||
import types, utils, formatters
|
||||
|
@ -297,7 +297,7 @@ proc expandTweetEntities*(tweet: Tweet; js: JsonNode) =
|
|||
proc expandNoteTweetEntities*(tweet: Tweet; js: JsonNode) =
|
||||
let
|
||||
entities = ? js{"entity_set"}
|
||||
text = js{"text"}.getStr
|
||||
text = xmltree.escape(js{"text"}.getStr)
|
||||
textSlice = 0..text.runeLen
|
||||
|
||||
tweet.expandTextEntities(entities, text, textSlice)
|
||||
|
|
Loading…
Reference in New Issue