1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-10-31 21:33:00 +00:00

Bugfix: Replace newline characters in internal links with spaces - fixes #186

This commit is contained in:
Starbeamrainbowlabs 2020-04-21 15:00:54 +01:00
parent ed9b6cfa51
commit f6a7495ce5
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -727,7 +727,7 @@ class PeppermintParsedown extends ParsedownExtreme
if(preg_match('/^\[\[([^\]]*)\]\]([^\s!?",;.()\[\]{}*=+\/]*)/u', $fragment["text"], $matches) === 1) { if(preg_match('/^\[\[([^\]]*)\]\]([^\s!?",;.()\[\]{}*=+\/]*)/u', $fragment["text"], $matches) === 1) {
// 1: Parse parameters out // 1: Parse parameters out
// ------------------------------- // -------------------------------
$link_page = trim($matches[1]); $link_page = str_replace(["\r", "\n"], [" ", " "], trim($matches[1]));
$display = $link_page . trim($matches[2]); $display = $link_page . trim($matches[2]);
if(strpos($matches[1], "|") !== false || strpos($matches[1], "¦") !== false) if(strpos($matches[1], "|") !== false || strpos($matches[1], "¦") !== false)
{ {