Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-TOOLBAR-098

A wikilink is found by file name, or refused when ambiguous or empty

When a wikilink is followed, the extension SHALL search every workspace root for a note of that file name (with .md added when the name has no extension) and open it when exactly one valid file matches, or the file of that name next to the document when none is found, and block the link when several match or no file does.

Part of StRS-MDOKFSTUDIO-TOOLBAR-011, outside the paths drawn on its map.

Scenarios 7

The situations the tests check; open one to read it.

nominalOne match
Givena note named Note.md in one folder of a two-folder workspace
Whenthe link [[Note]] is followed
Thenthat file opens, because the search by name runs before any sibling is accepted
nominalSibling fallback
Givenno file found by name and a Note.md next to the document
Whenthe link [[Note]] is followed
Thenthe sibling opens
boundaryName with or without an extension, with or without a folder
InputOutcome
[[Note]]the name searched is Note.md
[[data.txt]]searched with the name unchanged, because the name already has an extension
[[notes v1.2]]searched with the name unchanged, because the name already has an extension
[[sub/Note]] with a file sub/Note.md next to the documentopens it without a name search, because a name with a folder resolves relative only
[[sub/Note]] and no file sub/Note.md next to the documentblocked with The wikilink target is unavailable.
refusalSeveral files match
GivenNote.md in two folders
When[[Note]] is followed
Thenit is blocked with The wikilink is ambiguous; use a relative path to choose a note.
refusalNo file matches
Given[[Missing]]
Whenit is followed
Thenit is blocked with The wikilink target is unavailable.
boundaryA match outside the workspace does not count
Givenone match inside the workspace and one outside through a symlink
When[[Note]] is followed
Thenonly the valid match counts and it opens
boundaryOne search per name at a time
InputOutcome
two discovery requests for [[Note]] resolved togetherone file search runs and both share its result
a request after the search endeda new search runs

Implemented in 2

Tested by 2