Allow multiple links in one line
This commit is contained in:
parent
41dd1d6491
commit
8e7f80fa2f
|
@ -12,13 +12,15 @@ from markdown import Markdown
|
|||
ARTICLE_PATHS = {}
|
||||
FILE_PATHS = {}
|
||||
|
||||
link = r'\[\[\s*(?P<filename>[^|\]]+)(\|\s*(?P<linkname>.+))?\]\]'
|
||||
#link = r'\[\[\s*(?P<filename>[^|\]]+)(\|\s*(?P<linkname>.+))?\]\]' # greedy, broken multiple same line
|
||||
link = r'\[\[\s*(?P<filename>[^|\]]+?)(\|\s*(?P<linkname>.+?))?\]\]' # non-greedy
|
||||
file_re = re.compile(r'!' + link)
|
||||
link_re = re.compile(link)
|
||||
|
||||
|
||||
"""
|
||||
# Test cases
|
||||
be sure to check the [[The Useless Room|electronics room]] and [[Incubation Room]]
|
||||
[[my link]]
|
||||
[[ my work ]]
|
||||
[[ my work | is finished ]]
|
||||
|
|
Loading…
Reference in New Issue
Block a user