diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-05-06 13:29:07 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-05-06 13:29:14 +0200 |
commit | 3408efcc9d379d8ce8eb8c29db327e436ee5adb6 (patch) | |
tree | 231e92ffbad3d554efbf7985defc736adb5c1526 | |
parent | 0578bfd08637d3e113d28507ea73fa9a649f2f21 (diff) |
get_text should add newline for <br>
-rw-r--r-- | src/HtmlSearch.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); |