support languages with code blocks; link file:// protocol
This commit is contained in:
parent
2fd0d630b3
commit
c01500ce19
1 changed files with 11 additions and 4 deletions
15
moin2doku.py
15
moin2doku.py
|
@ -144,13 +144,20 @@ def convert_markup(content, filename):
|
||||||
('(\[\[.+\]\]).*\]', '\\1'),
|
('(\[\[.+\]\]).*\]', '\\1'),
|
||||||
|
|
||||||
# web link without title
|
# web link without title
|
||||||
('\[(http[^\s]+)\]', '[[\\1]]'),
|
('\[((?:http|https|file)[^\s]+)\]', '[[\\1]]'),
|
||||||
# web link with title
|
# web link with title
|
||||||
('\[(http[^\s]+)\s+(.+?)\]', '[[\\1|\\2]]'),
|
('\[((?:http|https|file)[^\s]+)\s+(.+?)\]', '[[\\1|\\2]]'),
|
||||||
|
|
||||||
('\["/(.*)"\]', '[['+filename[-1]+':\\1]]'),
|
('\["/(.*)"\]', '[['+filename[-1]+':\\1]]'),
|
||||||
('\{{3}', '<'+'code>'), # code open
|
|
||||||
('\}{3}', '<'+'/code>'), # code close
|
# code blocks
|
||||||
|
# open and language
|
||||||
|
('\{{3}#!(python|php)', '<'+'code \\1>'),
|
||||||
|
# code open
|
||||||
|
('\{{3}', '<'+'code>'),
|
||||||
|
# close
|
||||||
|
('\}{3}', '<'+'/code>'),
|
||||||
|
|
||||||
('^\s\s\s\s\*', ' *'),
|
('^\s\s\s\s\*', ' *'),
|
||||||
('^\s\s\s\*', ' *'),
|
('^\s\s\s\*', ' *'),
|
||||||
('^\s\s\*', ' *'),
|
('^\s\s\*', ' *'),
|
||||||
|
|
Loading…
Reference in a new issue