(tag)
| 194 | |
| 195 | |
| 196 | def do(tag): |
| 197 | name = getattr(tag, 'name', '').lower() |
| 198 | if not name: |
| 199 | text(tag) |
| 200 | elif name == 'h1': |
| 201 | macro('.SH', _force_string(tag, tag).upper()) |
| 202 | w.started = True |
| 203 | elif name == 'h2': |
| 204 | macro('.SS', _force_string(tag, tag)) |
| 205 | w.started = True |
| 206 | elif name.startswith('h') and len(name)==2: |
| 207 | raise ValueError('%r invalid - man page headers must be h1 or h2' |
| 208 | % name) |
| 209 | elif name == 'pre': |
| 210 | t = _force_string(tag.code, tag.code) |
| 211 | if t.strip(): |
| 212 | macro('.RS', '+4n') |
| 213 | macro('.nf') |
| 214 | w.write(_clean(t).rstrip()) |
| 215 | macro('.fi') |
| 216 | macro('.RE') |
| 217 | w.end_para() |
| 218 | elif name == 'p' or name == 'br': |
| 219 | g = re.match(re.compile(r'([^\n]*)\n *: +(.*)', re.S), str(tag)) |
| 220 | if g: |
| 221 | # it's a definition list (which some versions of python-markdown |
| 222 | # don't support, including the one in Debian-lenny, so we can't |
| 223 | # enable that markdown extension). Fake it up. |
| 224 | do_definition(tag) |
| 225 | else: |
| 226 | text(tag) |
| 227 | w.end_para() |
| 228 | elif name == 'ul': |
| 229 | do_list(tag) |
| 230 | else: |
| 231 | raise ValueError('non-man-compatible html tag %r' % name) |
| 232 | |
| 233 | |
| 234 | PROD='Untitled' |
no test coverage detected