aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-05-06 13:29:07 +0200
committerdec05eba <dec05eba@protonmail.com>2021-05-06 13:29:14 +0200
commit3408efcc9d379d8ce8eb8c29db327e436ee5adb6 (patch)
tree231e92ffbad3d554efbf7985defc736adb5c1526 /src
parent0578bfd08637d3e113d28507ea73fa9a649f2f21 (diff)
get_text should add newline for <br>
Diffstat (limited to 'src')
-rw-r--r--src/HtmlSearch.c5
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);