# HG changeset patch # User Paul Boddie # Date 1555450521 -7200 # Node ID 21d45d1771bae5977c90e092f4ea9d5e76be1e4f # Parent 1e22f88439cc2ac695004ff0503c41a57f16c416 Insist on links remaining within paragraphs. diff -r 1e22f88439cc -r 21d45d1771ba moinformat/parsers/moin.py --- a/moinformat/parsers/moin.py Tue Apr 16 00:46:27 2019 +0200 +++ b/moinformat/parsers/moin.py Tue Apr 16 23:35:21 2019 +0200 @@ -785,13 +785,13 @@ # Links and transclusions may start inline spans. "link" : join((r"\[\[", # [[ - group("target", r"\E*?"), # ... + group("target", r"\P*?"), # ... choice((r"\|", # | group("end", r"]]"))))), # ]] "transclusion" : join((r"\{\{", # {{ excl(r"\{"), # not-{ - group("target", ".*?"), # ... + group("target", r"\P*?"), # ... choice((r"\|", # | group("end", r"}}"))))), # }} diff -r 1e22f88439cc -r 21d45d1771ba tests/test_links.tree --- a/tests/test_links.tree Tue Apr 16 00:46:27 2019 +0200 +++ b/tests/test_links.tree Tue Apr 16 23:35:21 2019 +0200 @@ -74,3 +74,9 @@ Text Link Text + Break + Block + Text + Break + Block + Text diff -r 1e22f88439cc -r 21d45d1771ba tests/test_links.txt --- a/tests/test_links.txt Tue Apr 16 00:46:27 2019 +0200 +++ b/tests/test_links.txt Tue Apr 16 23:35:21 2019 +0200 @@ -12,3 +12,7 @@ link|wrapped link with label]], a [[link|link with wrapped label]], and a [[#wrapped intra-page link]]. + +Do not allow [[links + +broken into separate paragraphs]].