Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-FMSCHEMA-073

A resolving frontmatter link opens its target, others are refused with a warning

When a writer activates a frontmatter link (click or Enter in read mode, Cmd or Ctrl and click in edit mode), the extension SHALL open a resolving target in the editor at the marker line when the annotation has a `basename_marker`, keeping the query and fragment and recording the jump in the Back and Next history, and otherwise open nothing and show the warning "Markdown OKF-Schema Studio could not follow the link: {reason}" with the problem message as the reason.

Step 4 of path 1 in StRS-MDOKFSTUDIO-FMSCHEMA-014: from “The link is a focusable link” to “The target is open in the editor”.

Scenarios 5

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

nominalFollow with a marker
Givena valid link whose annotation has a basename_marker found at line 10 of the target
Whenthe writer presses Enter on it in read mode
Thenthe target opens in the editor at line 10 and the history gains an entry
nominalFollow without a marker line
InputOutcome
A valid link whose marker is carried by no line of the targetThe target still opens, at the top
A filename-stem linkRe-resolved at click time, then opened
nominalEdit mode
Giventhe preview is in edit mode and the link sits in an editable value cell
Whenthe writer clicks the link without a modifier
Thenthe field editor opens and the link is not followed; Cmd or Ctrl and click follows it
refusalUnusable link
InputOutcome
A link whose target does not exist, activated through its navigation requestNo editor is opened and the history is unchanged; VS Code shows the warning with the E10 message as the reason
A document-relative link outside the workspace with allowOutsideWorkspaceLinks falseNo editor is opened
An invalid or unavailable linkNot followed
boundaryLink result without a message
Givena link result without a message
Whenthe request is handled
Thenthe reason reads The frontmatter link is unavailable.

Implemented in 1

Tested by 3

Replaces

SwRS-MDOKFSTUDIO-FMSCHEMA-074An unusable frontmatter link is not followed superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-073 Markdown file
SwRS-MDOKFSTUDIO-FMSCHEMA-082A refused frontmatter link shows a warning with its reason superseded superseded by SwRS-MDOKFSTUDIO-FMSCHEMA-073 Markdown file