Skip to content

Commit

Permalink
Strip trailing newlines from tweets
Browse files Browse the repository at this point in the history
  • Loading branch information
zedeus committed Jan 16, 2022
1 parent cdf49dc commit 6f348f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/parserutils.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-only
import strutils, times, macros, htmlgen, unicode, options, algorithm
import std/re
import std/[strutils, times, macros, htmlgen, options, algorithm, re]
import std/unicode except strip
import packedjson
import types, utils, formatters

Expand Down Expand Up @@ -275,3 +275,4 @@ proc expandTweetEntities*(tweet: Tweet; js: JsonNode) =
replacements.sort(cmp)

tweet.text = orig.replacedWith(replacements, textSlice)
.strip(leading=false)

0 comments on commit 6f348f2

Please sign in to comment.