From 3408efcc9d379d8ce8eb8c29db327e436ee5adb6 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 6 May 2021 13:29:07 +0200 Subject: get_text should add newline for
--- src/HtmlSearch.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/HtmlSearch.c b/src/HtmlSearch.c index b7801b9..9fb4daa 100644 --- a/src/HtmlSearch.c +++ b/src/HtmlSearch.c @@ -66,6 +66,11 @@ static void strip_newline(const char *str, size_t size, const char **output_str, static int add_inner_text_recursive(const TidyDoc doc, const TidyNode node, QuickMediaString *str) { for(TidyNode child = tidyGetChild(node); child; child = tidyGetNext(child)) { + const char *node_name = tidyNodeGetName(child); + if(node_name && strcmp(node_name, "br") == 0) { + string_append(str, "\n", 1); + } + if(tidyNodeGetType(child) == TidyNode_Text) { TidyBuffer tidy_buffer; tidyBufInit(&tidy_buffer); -- cgit v1.2.3