From 06d84ec9f32a50c6084bc534a36ade6ead4ec693 Mon Sep 17 00:00:00 2001 From: NickLin Date: Mon, 1 Jun 2026 11:57:28 +0000 Subject: [PATCH] Fix: escaped pipe in table wikilinks leaves trailing backslash in URL path When [[file.md\|Label]] is used inside a Markdown table, the backslash escape is left in the file path after splitting on '|', causing browsers to normalize it to '/', resulting in a broken URL like {host}/file.md/. --- perlite/.src/PerliteParsedown.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perlite/.src/PerliteParsedown.php b/perlite/.src/PerliteParsedown.php index b6164e17..baea4013 100644 --- a/perlite/.src/PerliteParsedown.php +++ b/perlite/.src/PerliteParsedown.php @@ -1266,8 +1266,9 @@ protected function inlineInternalLink($Excerpt) $raw = $matches[1]; // Split Obsidian-style: file|label|popup + // Strip backslash used to escape | in Markdown tables (e.g. [[file.md\|Label]]) $parts = explode('|', $raw); - $linkFile = $parts[0]; + $linkFile = rtrim($parts[0], '\\'); $ext = pathinfo($linkFile, PATHINFO_EXTENSION); $openNewTab = false;