Skip to content

Fix: escaped pipe in table wikilinks leaves trailing backslash in URL path#184

Open
Nick-LCY wants to merge 1 commit into
secure-77:devfrom
Nick-LCY:fix/wikilink-escaped-pipe-in-table
Open

Fix: escaped pipe in table wikilinks leaves trailing backslash in URL path#184
Nick-LCY wants to merge 1 commit into
secure-77:devfrom
Nick-LCY:fix/wikilink-escaped-pipe-in-table

Conversation

@Nick-LCY

@Nick-LCY Nick-LCY commented Jun 1, 2026

Copy link
Copy Markdown

Summary

Wikilinks with display names use | as a separator: [[file.md|Label]]. When used inside a Markdown table, the pipe must be escaped to avoid being parsed as a column delimiter: [[file.md\|Label]].

inlineInternalLink() splits on | using explode(), leaving a trailing backslash in the file path ($linkFile = "file.md\"). Browsers normalize \ to / in URL paths, turning the href into {host}/file.md/, which resolves as a directory and fails to find the file.

Example

1

Fix

Strip the trailing backslash from $linkFile after splitting:

  $linkFile = rtrim($linkFile, '\\');

The backslash in | is a Markdown escape character with no meaning in the file path itself. This makes [[file.md|Label]] behave identically to [[file.md|Label]].

Impact

  • Wikilinks with display names inside tables now navigate correctly
  • No behavior change for wikilinks outside tables

… 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/.
@Nick-LCY Nick-LCY changed the base branch from main to dev June 1, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant