Remove more punctuation when creating links.
Chris Pressey
7 years ago
9 | 9 | if 'link-to-anchors-on' not in section.document.properties: |
10 | 10 | return None |
11 | 11 | |
12 | title = re.sub(r"[':,]", '', section.title) | |
12 | title = re.sub(r"[':,.!]", '', section.title) | |
13 | 13 | anchor = (title.replace(u' ', u'-').lower()).encode('utf-8') |
14 | 14 | return '{}#{}'.format(section.document.properties['link-to-anchors-on'], quote_plus(anchor)) |
15 | 15 |