Normalize whitespace for a string of HTML using `tidylib`.
(text)
| 127 | |
| 128 | |
| 129 | def _normalize_whitespace(text): |
| 130 | """ Normalize whitespace for a string of HTML using `tidylib`. """ |
| 131 | output, errors = tidylib.tidy_fragment(text, options={ |
| 132 | 'drop_empty_paras': 0, |
| 133 | 'fix_backslash': 0, |
| 134 | 'fix_bad_comments': 0, |
| 135 | 'fix_uri': 0, |
| 136 | 'join_styles': 0, |
| 137 | 'lower_literals': 0, |
| 138 | 'merge_divs': 0, |
| 139 | 'output_xhtml': 1, |
| 140 | 'quote_ampersand': 0, |
| 141 | 'newline': 'LF' |
| 142 | }) |
| 143 | return output |
| 144 | |
| 145 | |
| 146 | class LegacyTestMeta(type): |
no outgoing calls
no test coverage detected
searching dependent graphs…