Removes existing [back to top] links and tags.
(lines, remove=('[[back to top]', '<a class="mk-toclify"'))
| 45 | return in_contents |
| 46 | |
| 47 | def removeLines(lines, remove=('[[back to top]', '<a class="mk-toclify"')): |
| 48 | """Removes existing [back to top] links and <a id> tags.""" |
| 49 | |
| 50 | if not remove: |
| 51 | return lines[:] |
| 52 | |
| 53 | out = [] |
| 54 | for l in lines: |
| 55 | if l.startswith(remove): |
| 56 | continue |
| 57 | out.append(l) |
| 58 | return out |
| 59 | |
| 60 | def removeToC(lines): |
| 61 | """Removes existing table of contents starting at index contentLineNdx.""" |