Return an iterator of unicode text lines for the file at `location` lightly stripping markup if the file is some kind of markup, such as HTML, XML, PHP, etc. The whitespaces are collapsed to one space. Use the ``stripper`` callable, one of demarkup_text or strip_markup_text.
(location, stripper=demarkup_text)
| 248 | |
| 249 | |
| 250 | def demarkup(location, stripper=demarkup_text): |
| 251 | """ |
| 252 | Return an iterator of unicode text lines for the file at `location` lightly |
| 253 | stripping markup if the file is some kind of markup, such as HTML, XML, PHP, |
| 254 | etc. The whitespaces are collapsed to one space. |
| 255 | |
| 256 | Use the ``stripper`` callable, one of demarkup_text or strip_markup_text. |
| 257 | """ |
| 258 | from textcode.analysis import unicode_text_lines |
| 259 | |
| 260 | for line in unicode_text_lines(location): |
| 261 | if TRACE: |
| 262 | logger_debug(f"demarkup: {line} : demarked: {demarkup(line)}") |
| 263 | yield stripper(line) |
| 264 | |
| 265 | |
| 266 | # ## Old style stripper |
nothing calls this directly
no test coverage detected