PyTidyLib
_ is a Python package that wraps theHTML Tidy
_ library. This allows you, from Python code, to "fix" invalid (X)HTML markup. Some of the library's many capabilities include:
pre
elements,
which some (X)HTML indenting code overlooks.The following code cleans up an invalid HTML document and sets an option::
from tidylib import tidy_document
document, errors = tidy_document('''<p>f&otilde;o <img src="bar.jpg">''',
options={'numeric-entities':1})
print document
print errors
Package Version | Update ID | Released | Package Hub Version | Platforms | Subpackages |
---|---|---|---|---|---|
0.3.2-bp156.3.1 info | GA Release | 2023-07-22 | 15 SP6 |
|
|
0.3.2-bp155.2.11 info | GA Release | 2023-05-22 | 15 SP5 |
|
|
0.3.2-bp154.1.22 info | GA Release | 2022-05-09 | 15 SP4 |
|
|
0.3.2-bp153.1.17 info | GA Release | 2021-03-06 | 15 SP3 |
|
|
0.3.2-bp152.1.10 info | GA Release | 2020-04-17 | 15 SP2 |
|
|
0.2.4-bp151.3.1 info | GA Release | 2019-07-17 | 15 SP1 |
|
|
0.2.4-bp151.2.10 info | GA Release | 2019-05-18 | 15 SP1 |
|
|
0.2.4-bp150.2.4 info | GA Release | 2018-07-30 | 15 |
|
|