From fd7b1c8700761f7af093c145fd5004889e0fbd54 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 10 Jan 2021 20:34:27 +0200 Subject: Feeds: Don't trim opening parens/brackets IssueID #114 --- src/feeds.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/feeds.c') diff --git a/src/feeds.c b/src/feeds.c index 06aaed85..0f06e33d 100644 --- a/src/feeds.c +++ b/src/feeds.c @@ -164,13 +164,19 @@ static iFeedJob *startNextJob_Feeds_(iFeeds *d) { return job; } +static iBool isTrimmablePunctuation_(iChar c) { + if (c == '(' || c == '[' || c == '{' || c == '<') { + return iFalse; + } + /* Dashes or punctuation? */ + return c == 0x2013 || c == 0x2014 || (c < 128 && ispunct(c)); +} + static void trimTitle_(iString *title) { const char *start = constBegin_String(title); iConstForEach(String, i, title) { start = i.pos; - if (!isSpace_Char(i.value) && - /* Dashes or punctuation? */ - !(i.value == 0x2013 || i.value == 0x2014 || (i.value < 128 && ispunct(i.value)))) { + if (!isSpace_Char(i.value) && !isTrimmablePunctuation_(i.value)) { break; } } -- cgit v1.2.3