aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-11-06 13:50:16 +0100
committerdec05eba <dec05eba@protonmail.com>2022-11-06 13:51:09 +0100
commit684a3bc56d5c40ed3eb54ca263751fa4724e73fa (patch)
treedd743e6f9b56e7ae3e969b9d5a437010100b3752 /src
parentfe3993c221a604f5fb9f7ef1ba6179740cbf9173 (diff)
Call callback even if text only contains whitespace
Diffstat (limited to 'src')
-rw-r--r--src/HtmlParser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/HtmlParser.c b/src/HtmlParser.c
index fafcf5a..5f57dd3 100644
--- a/src/HtmlParser.c
+++ b/src/HtmlParser.c
@@ -297,7 +297,7 @@ static int html_parser_goto_script_end_tag(HtmlParser *self) {
}
}
- if(self->text_stripped.size > 0) {
+ if(self->text.size > 0) {
res = self->parse_callback(self, HTML_PARSE_JAVASCRIPT_CODE, self->callback_userdata);
if(res != 0)
return res;
@@ -511,7 +511,7 @@ int html_parser_parse(const char *html_source, size_t len, HtmlParseCallback par
}
self.text.size = (self.source + self.offset) - self.text.data;
strip(self.text.data, self.text.size, &self.text_stripped.data, &self.text_stripped.size, is_whitespace);
- if(self.text_stripped.size > 0) {
+ if(self.text.size > 0) {
res = self.parse_callback(&self, HTML_PARSE_TEXT, self.callback_userdata);
if(res != 0)
return res;