Skip to content

Commit

Permalink
lib-mail: html2text: do not parse entity when quote_level > 0.
Browse files Browse the repository at this point in the history
&entities inside blockquotes are added to text, while other text is
not, this leads to strange results.
  • Loading branch information
Sergey-Kitov authored and villesavolainen committed Apr 17, 2018
1 parent a9b8af2 commit d18b938
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/lib-mail/mail-html2text.c
Expand Up @@ -191,13 +191,15 @@ parse_data(struct mail_html2text *ht,
if (ret == 0)
return i;
i += ret - 1;
} else if (c == '&') {
ret = parse_entity(data+i+1, size-i-1, output);
if (ret == 0)
return i;
i += ret - 1;
} else if (ht->quote_level == 0) {
buffer_append_c(output, c);
if (c == '&') {
ret = parse_entity(data+i+1, size-i-1, output);
if (ret == 0)
return i;
i += ret - 1;
} else {
buffer_append_c(output, c);
}
}
break;
case HTML_STATE_TAG:
Expand Down

0 comments on commit d18b938

Please sign in to comment.