mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-11 11:22:15 -04:00
13 lines
292 B
Python
13 lines
292 B
Python
import re
|
|
|
|
def striptags(text):
|
|
return re.compile(r'<[^>]*>').sub('', text)
|
|
|
|
def go(m):
|
|
# .html with no anchor if present, otherwise "#" for top of page
|
|
return m.group(1) or '#'
|
|
|
|
def strip_toplevel_anchors(text):
|
|
return re.compile(r'(\.html)?#[-\w]+-toplevel').sub(go, text)
|
|
|