Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-REVIEW-017

The quote of a thread is highlighted once in its block, also over a line break of the source

When review threads are applied to the page, the extension SHALL wrap the first occurrence of each thread quote, found inside one text node of the innermost mapped block that covers the anchor line, in one highlight, or add a badge to that block when the quote is not found inside one text node, and never mark code, math, diagrams, the properties table, open editors or included content; a run of whitespace of the text node, such as the line break of a paragraph or list item wrapped over several lines of the source, matches a space of the quote, and the matched text is highlighted as one highlight.

Step 2 of path 1 in StRS-MDOKFSTUDIO-REVIEW-001: from “The threads reach the page” to “The quoted text is highlighted”.

Scenarios 11

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

nominalQuote in the block of the line
Giventwo paragraphs holding the same sentence and a thread anchored on the line of the second
Whenthe thread is posted
Thenonly the sentence of the second paragraph is highlighted, in preview and in edit mode
boundaryQuote at the start of a text node
Givena thread whose quote starts a text node
Whenthe thread is posted and then cleared
Thenno empty text node is left before the highlight and clearing restores the original structure
refusalRegions that are never marked
InputOutcome
Threads anchored on a code block, math, the properties table and a block under an open editorNo highlight is created in any of them
A block that comes from an include directive and carries lines of another file, with a thread anchor line inside itThe block is not chosen for the highlight
A review thread whose quote text also appears inside a Mermaid figure and a PlantUML figureNo comment mark is added inside either figure
boundarySame text in a figure and in a paragraph
Giventhe same quote text in an ordinary paragraph covering the anchor line
Whenthe page applies the threads
Thenthe paragraph, not the figure, receives the mark
nominalQuote across an element boundary
Givena paragraph whose quote runs through an emphasised word, and a thread with two comments
Whenthe thread is posted
Thenno highlight is made and the paragraph holds a badge button with the label "Comment thread, 2 comments"
boundaryBlock that takes no children
Givena thread anchored on a table, a list, a code block, a details block, an image or a rule
Whenthe thread is posted
Thenthe badge sits after the block
boundaryApplied again
InputOutcome
The same threads applied a second time to a page with a highlighted quoteThe page holds one highlight, as after the first run
A content patch that replaces the blocks, then the threads applied againThe highlight is on the new content and none is left on removed nodes
nominalResolved style
InputOutcome
A resolved thread with a highlighted quoteThe highlight carries the resolved attribute and is drawn differently from an open one; its badge and orphaned comments entry are drawn in the resolved style too
An open threadThe highlight has no resolved attribute
nominalQuote over a wrapped line
Givena paragraph wrapped over several lines of the source, so that its text node holds a line break, and a thread whose quote has a space where the line break is
Whenthe thread is posted
Thenthe text from the first to the last word of the quote is highlighted once, with the line break kept inside the highlight, and the text of the page does not change
boundaryLong document
Givena long document with raw HTML, images and tables whose paragraphs, list items and cells are wrapped, and one thread on each text of them, re-anchored by the host
Whenthe threads are posted
Thenevery thread is highlighted on its text, none gets a badge or goes to the Orphaned comments box, and the length of the document changes nothing
refusalAnother word
Givena quote with a word that the text node does not hold at that place
Whenthe thread is posted
Thenno highlight is created and the existing rule applies: a badge on the block of the line

Implemented in 2

Tested by 2

Replaces

SwRS-MDOKFSTUDIO-DIAG-019Comment quotes are never wrapped inside diagrams superseded superseded by SwRS-MDOKFSTUDIO-REVIEW-017 Markdown file
SwRS-MDOKFSTUDIO-REVIEW-216A quote over a line break of the source is highlighted superseded superseded by SwRS-MDOKFSTUDIO-REVIEW-017 Markdown file