aboutsummaryrefslogtreecommitdiff
path: root/trac2md.py
diff options
context:
space:
mode:
Diffstat (limited to 'trac2md.py')
-rwxr-xr-xtrac2md.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/trac2md.py b/trac2md.py
index 38038f3..c97b569 100755
--- a/trac2md.py
+++ b/trac2md.py
@@ -14,14 +14,17 @@ from base64 import b64decode
from datetime import datetime
from urllib.parse import quote
-wikilink_1_pattern = re.compile("\[\[(http.*)\]\]|\[(http.*)\]")
-wikilink_2_pattern = re.compile("\[\[(?:wiki:)?([a-zA-Z0-9_]+)\]\]|\[wiki:(.+)\]")
-strikethrough_pattern = re.compile("~~(.*)~~")
-camelcase_pattern = re.compile("!(\w+)")
-image_pattern = re.compile("\[\[Image\((.*)\)\]\]")
-
-wikiheading_patterns = tuple((level, re.compile("^{} (.*)[ \t]*=*$".format("=" * level)))
- for level in range(1, 7))
+image_pattern = re.compile(r"\[\[Image\((.*)\)\]\]")
+
+wikilink_1_pattern = re.compile(r"\[\[(http.*)\]\]|\[(http.*)\]")
+wikilink_2_pattern = re.compile(r"\[\[(?:wiki:)?([a-zA-Z0-9_]+)\]\]|\[wiki:(.+)\]")
+
+strikethrough_pattern = re.compile(r"~~(.*)~~")
+camelcase_pattern = re.compile(r"!((?:\w|[#])+)")
+
+wikiheading_patterns = tuple(
+ (level, re.compile("^{} (.*)[ \t]*=*$".format("=" * level)))
+ for level in range(1, 7))
def to_timestamp(tm):
''' Convert to timestamp which can be jsonified '''