Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-TOOLBAR-006

Search and navigation unfold the folded section of their target

When the browser find reaches text inside a folded section, or the page navigates to an anchor, a table-of-contents entry or a link target inside one, the extension SHALL unfold the folded sections that contain the target before it is shown.

Another outcome at step 3 of path 1 in StRS-MDOKFSTUDIO-TOOLBAR-002, in the state “The folds stay as the reader left them”.

Scenarios 3

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

nominalThe browser find opens the section
Givena folded section whose blocks are hidden="until-found"
Whenthe browser find (Cmd/Ctrl+F) matches text in one of those blocks and the browser fires beforematch
Thenthe page unfolds every folded section that holds the block, and the match is shown
nominalNavigation opens the section
Givena target inside a folded section
Whena same-page link, a table-of-contents entry or an editor-to-preview navigation brings the page to the target
Thenthe folded sections that hold the target are unfolded and the layout is measured again before the page scrolls
boundaryOnly the sections around the target open
InputOutcome
A target under a folded h1 and a folded h2 that both hold itBoth open
A folded section after the target, or a folded sibling sectionIt stays folded
A target that is not inside a folded sectionNothing changes and no layout pass runs

Implemented in 2

Tested by 2