From 7d680a393f81e80fd54a6234fd8be5d3144363f5 Mon Sep 17 00:00:00 2001 From: Joe Littlejohn Date: Wed, 19 Jun 2013 21:12:41 +0100 Subject: [PATCH] add support for single line pre blocks --- wikiconvert.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wikiconvert.py b/wikiconvert.py index b7a0e50..f1d8a91 100644 --- a/wikiconvert.py +++ b/wikiconvert.py @@ -56,6 +56,7 @@ def sub_pre_block(match): s_from_hash[hash] = _indent(pre) return hash text = re.compile(r'^{{{\n(.*?)^}}}', re.M|re.S).sub(sub_pre_block, text) + text = re.compile(r'^{{{(.*?)}}}\s*$', re.M).sub(lambda m: "`%s`\n"%m.group(1).strip(), text) # Headings. text = re.compile(r'^===(.*?)===\s*$', re.M).sub(lambda m: "### %s\n"%m.group(1).strip(), text)