From a87880a43c06e9475b59e6c7741c695b4e41b20c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 15 Aug 2021 15:16:29 +0200 Subject: Strip newlines at the beginning and end of text --- src/HtmlSearch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HtmlSearch.c b/src/HtmlSearch.c index d72055a..ebf2e4a 100644 --- a/src/HtmlSearch.c +++ b/src/HtmlSearch.c @@ -448,8 +448,8 @@ static int merge_inner_text(QuickMediaHtmlNode *node, QuickMediaString *str) { const char *inner_text = node->name.data; size_t inner_text_size = node->name.size; strip(inner_text, inner_text_size, &inner_text, &inner_text_size, is_newline); - if(inner_text_size > 0) { /* ignore empty text, but add the original text */ - if(string_append(str, node->name.data, node->name.size) != 0) + if(inner_text_size > 0) { + if(string_append(str, inner_text, inner_text_size) != 0) return 1; } } -- cgit v1.2.3