diff options
author | Araq <rumpf_a@web.de> | 2019-09-04 11:20:30 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-09-04 11:20:30 +0200 |
commit | fa5707e7e2494065be09f4e4f0590140399cd215 (patch) | |
tree | 2f257ca9bbf61eb51b8851b5c64a7b5162f80273 /tests/stdlib/thtmlparser.nim | |
parent | cb0450398a5695e1e1193e6c49ff9c7548980438 (diff) | |
download | Nim-fa5707e7e2494065be09f4e4f0590140399cd215.tar.gz |
fixes #11713, fixes #1034
Diffstat (limited to 'tests/stdlib/thtmlparser.nim')
-rw-r--r-- | tests/stdlib/thtmlparser.nim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/stdlib/thtmlparser.nim b/tests/stdlib/thtmlparser.nim index 0457585d0..ccf2f6202 100644 --- a/tests/stdlib/thtmlparser.nim +++ b/tests/stdlib/thtmlparser.nim @@ -2,6 +2,9 @@ discard """ output: ''' @[] true +https://example.com/test?format=jpg&name=orig## +https://example.com/test?format=jpg&name=orig##text +https://example.com/test?format=jpg##text ''' """ import htmlparser @@ -136,3 +139,20 @@ block t6154: doAssert ps[6].attr("quux") == "" doAssert ps[6].attr("whatever") == "" doassert ps[6].len == 0 + +# bug #11713, #1034 +var content = """ +# with & +<img src="https://example.com/test?format=jpg&name=orig" alt=""> +<img src="https://example.com/test?format=jpg&name=orig" alt="text"> + +# without & +<img src="https://example.com/test?format=jpg" alt="text"> +""" + +var + stream = newStringStream(content) + body = parseHtml(stream) + +for y in body.findAll("img"): + echo y.attr("src"), "##", y.attr("alt") |