From 8e7f80fa2f5c37f0227d676af4aa435ba11b8f13 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Mon, 11 Nov 2024 19:28:15 +0200 Subject: [PATCH] Allow multiple links in one line --- pelican/plugins/obsidian/obsidian.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pelican/plugins/obsidian/obsidian.py b/pelican/plugins/obsidian/obsidian.py index ef53ade..673d7f0 100644 --- a/pelican/plugins/obsidian/obsidian.py +++ b/pelican/plugins/obsidian/obsidian.py @@ -12,13 +12,15 @@ from markdown import Markdown ARTICLE_PATHS = {} FILE_PATHS = {} -link = r'\[\[\s*(?P[^|\]]+)(\|\s*(?P.+))?\]\]' +#link = r'\[\[\s*(?P[^|\]]+)(\|\s*(?P.+))?\]\]' # greedy, broken multiple same line +link = r'\[\[\s*(?P[^|\]]+?)(\|\s*(?P.+?))?\]\]' # 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 ]]