Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Remove old-school "wiki link escapes" such as !FooBar #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions wikiconvert.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ def sub_wikilink(m):
return hash
text = re.compile(r'\[((?:[A-Z][a-z]+)+)(?:\s+(.*?))?\]', re.S).sub(sub_wikilink, text)

# Wiki link escapes
text = re.compile(r'(\s|\A)!([A-Z]\w+)(\s|\B)').sub(r'\1\2\3', text)

# Links
def sub_link(m):
s = "[%s](%s)" % (m.group(2), m.group(1))
Expand Down