summaryrefslogtreecommitdiff
path: root/src/feeds.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-01-10 20:34:27 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-01-10 20:34:27 +0200
commitfd7b1c8700761f7af093c145fd5004889e0fbd54 (patch)
tree45cdb1950d5d1d9ddd34fe7bae4ed9ec4b9a95ce /src/feeds.c
parent209b1d96b0c5c63ee78601938a32eaa9fa52512e (diff)
Feeds: Don't trim opening parens/brackets
IssueID #114
Diffstat (limited to 'src/feeds.c')
-rw-r--r--src/feeds.c12
1 files changed, 9 insertions, 3 deletions
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) {
164 return job; 164 return job;
165} 165}
166 166
167static iBool isTrimmablePunctuation_(iChar c) {
168 if (c == '(' || c == '[' || c == '{' || c == '<') {
169 return iFalse;
170 }
171 /* Dashes or punctuation? */
172 return c == 0x2013 || c == 0x2014 || (c < 128 && ispunct(c));
173}
174
167static void trimTitle_(iString *title) { 175static void trimTitle_(iString *title) {
168 const char *start = constBegin_String(title); 176 const char *start = constBegin_String(title);
169 iConstForEach(String, i, title) { 177 iConstForEach(String, i, title) {
170 start = i.pos; 178 start = i.pos;
171 if (!isSpace_Char(i.value) && 179 if (!isSpace_Char(i.value) && !isTrimmablePunctuation_(i.value)) {
172 /* Dashes or punctuation? */
173 !(i.value == 0x2013 || i.value == 0x2014 || (i.value < 128 && ispunct(i.value)))) {
174 break; 180 break;
175 } 181 }
176 } 182 }