From 6f348f2f2e30a056829af16e2f28f6bcd45dc014 Mon Sep 17 00:00:00 2001 From: Zed Date: Sun, 16 Jan 2022 06:18:01 +0100 Subject: [PATCH] Strip trailing newlines from tweets --- src/parserutils.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/parserutils.nim b/src/parserutils.nim index aae3dfc..3291955 100644 --- a/src/parserutils.nim +++ b/src/parserutils.nim @@ -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 @@ -275,3 +275,4 @@ proc expandTweetEntities*(tweet: Tweet; js: JsonNode) = replacements.sort(cmp) tweet.text = orig.replacedWith(replacements, textSlice) + .strip(leading=false)