http://hg.code.sf.net:8000/p/roundup/code/atom-log/tip/test/html_norm.py Mercurial Repository: p/roundup/code: test/html_norm.py history 2023-07-23T16:11:23-04:00 prevent <newline tag mangling http://hg.code.sf.net:8000/p/roundup/code/#changeset-5cadcaa13bed62660ef02ba38b390efa55cd4e40 John Rouillard rouilj@ieee.org 2023-07-23T16:11:23-04:00 2023-07-23T16:11:23-04:00
changeset 5cadcaa13bed
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description prevent <newline tag mangling

remove charref and entityref handlers; change where newline inserted
after start tag.

A test under python2 ended up with a newline between the opening '<'
and the tag. This was caused by a string that had escaped &gt; and
&lt;.

embedded code block &lt;pre&gt\n\n<pre> python\nline 1\nline 2\n</pre>

The code was mapping &lt; etc back to < and > and confusing the parser
as to where the tag really started. It inserpreted the real pre tag as
data and inserted a newline.
files
fix typos in docstring. http://hg.code.sf.net:8000/p/roundup/code/#changeset-5bc36b65d06b5203303a2b676500b30cf1974d47 John Rouillard rouilj@ieee.org 2022-11-24T21:44:32-05:00 2022-11-24T21:44:32-05:00
changeset 5bc36b65d06b
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fix typos in docstring.
files
Add support for python2. http://hg.code.sf.net:8000/p/roundup/code/#changeset-3546f23ea4930adbdd6b4b08031ddfe03841acbd John Rouillard rouilj@ieee.org 2022-10-02T23:46:24-04:00 2022-10-02T23:46:24-04:00
changeset 3546f23ea493
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Add support for python2.

My development install has a backport for html.parser so it didn't
fail import but did in CI.
files
change test to use html normalizer when comparing html output. http://hg.code.sf.net:8000/p/roundup/code/#changeset-dc83ebff4c90d1183b219c997bdb4be3144dec02 John Rouillard rouilj@ieee.org 2022-10-02T23:18:43-04:00 2022-10-02T23:18:43-04:00
changeset dc83ebff4c90
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description change test to use html normalizer when comparing html output.

Update to Markdown2 parser changed text output keeping same html
semantics. Broke test_string_markdown_code_block_attribute test. I
hand patched it to get tests working but it needed a better solution.

Write a simple html normalizer using HTMLParser so I don't need third
party (lxml, beautifulsoup) library to clean up the test.

Use the normalizer to parser the expected result and the result
returned by the various markdown libraries. Hopefully this will make
the test less fragile.

This can have multiple uses in template testing where html is
compared. I expect to have to change html_norm.py to make test
writing easier in the future.
files