mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-06 03:50:08 +02:00
Merge pull request #526 from deltachat/quotes
crop ">" only for other muas
This commit is contained in:
commit
2fd1d2b727
4 changed files with 28 additions and 16 deletions
|
@ -170,22 +170,22 @@ void stress_functions(dc_context_t* context)
|
|||
dc_simplify_t* simplify = dc_simplify_new();
|
||||
|
||||
const char* html = "\r\r\nline1<br>\r\n\r\n\r\rline2\n\r"; /* check, that `<br>\ntext` does not result in `\n text` */
|
||||
char* plain = dc_simplify_simplify(simplify, html, strlen(html), 1);
|
||||
char* plain = dc_simplify_simplify(simplify, html, strlen(html), 1, 0);
|
||||
assert( strcmp(plain, "line1\nline2")==0 );
|
||||
free(plain);
|
||||
|
||||
html = "<a href=url>text</a"; /* check unquoted attribute and unclosed end-tag */
|
||||
plain = dc_simplify_simplify(simplify, html, strlen(html), 1);
|
||||
plain = dc_simplify_simplify(simplify, html, strlen(html), 1, 0);
|
||||
assert( strcmp(plain, "[text](url)")==0 );
|
||||
free(plain);
|
||||
|
||||
html = "<!DOCTYPE name [<!DOCTYPE ...>]><!-- comment -->text <b><?php echo ... ?>bold</b><![CDATA[<>]]>";
|
||||
plain = dc_simplify_simplify(simplify, html, strlen(html), 1);
|
||||
plain = dc_simplify_simplify(simplify, html, strlen(html), 1, 0);
|
||||
assert( strcmp(plain, "text *bold*<>")==0 );
|
||||
free(plain);
|
||||
|
||||
html = "<>"'& äÄöÖüÜß fooÆçÇ ♦&noent;‎‏‌‍";
|
||||
plain = dc_simplify_simplify(simplify, html, strlen(html), 1);
|
||||
plain = dc_simplify_simplify(simplify, html, strlen(html), 1, 0);
|
||||
assert( strcmp(plain, "<>\"'& äÄöÖüÜß fooÆçÇ ♦&noent;")==0 );
|
||||
free(plain);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue