Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-REVIEW-186

The host appends a valid reply inside the thread comment under the author

When the host receives a reply to an inline thread, the extension SHALL, if the named lines are still exactly one thread comment and the document has not changed meanwhile, add one message, a header with the author on one line and the local date and time as YYYY-MM-DD HH:MM and the reply text indented by two spaces, above the closing --> and change nothing else, and otherwise answer with the reason and leave the document unchanged; a previewThreadReply message is dropped unless it has an edit id, integer lines with 1 <= line <= endLine and a text of 1 to 10 000 characters that is not blank.

Step 3 of path 1 in StRS-MDOKFSTUDIO-REVIEW-015: from “The reply is sent with the lines of the thread” to “The reply is in the thread comment”.

Part of StRS-MDOKFSTUDIO-REVIEW-003, outside the paths drawn on its map.

Scenarios 8

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

nominalReply above the closing marker
Givena thread whose closing marker is alone on its line, a reply "hi\nthere", the author Bob and text before and after the thread
Whenthe reply is applied
Thenthe lines "Bob (2026-10-17 08:00):", " hi", " there" are added above "-->", the date is the local time as YYYY-MM-DD HH:MM, and the text before and after the thread is unchanged byte for byte
nominalLine break, indentation and text after the marker
Givena document with CRLF line ends, or a closing marker indented by two spaces and followed by a space
Whena reply is applied
Thenevery new line ends with CRLF and no lone LF appears, and the marker keeps both its two-space indentation and the text after it
nominalAuthor in the header
Giventhe setting authorName set to Bob Reviewer, or an author name holding a line break and a tab
Whena reply is applied
Thenthe header reads Bob Reviewer followed by the date, and a name with a line break or a tab is written on one line with single spaces
boundaryClosing marker position and marker in the text
InputOutcome
The lines "<!-- THREAD", "Ada (2026-10-16 10:47):", " hello -->" and a reply xthe last lines become " hello", the reply header, " x" and "-->": the text stays on its line and the marker moves below the reply
A closing marker alone on its lineno line is split
A reply "a --> b"the line reads " a -- > b" and the comment stays open; no reply line contains -->
A reply without the markerthe text is written as typed
refusalLines that are not exactly one thread
InputOutcome
Lines 5 to 8 that hold exactly one thread commentthe reply is applied
Lines that hold ordinary textthe answer is "The thread is no longer in the source. Refresh the preview." and the document is unchanged
Lines that hold a part of the threadthe answer is "The thread is no longer in the source. Refresh the preview." and the document is unchanged
Lines that hold the thread and morethe answer is "The thread is no longer in the source. Refresh the preview." and the document is unchanged
refusalDocument changed while the author is resolved
InputOutcome
A reply whose author lookup is slow and an edit of the document in betweenthe answer is "The document changed meanwhile. Try again." and nothing is changed
No edit in betweenthe reply is planned and applied
nominalValid reply message
Givena previewThreadReply message with an edit id, lines 5 and 8 and the text ok
Whenthe message is validated
Thenit is accepted
refusalInvalid reply message
InputOutcome
A missing edit iddropped
Line 0dropped
An end line before the linedropped
A blank text in a previewThreadReplydropped
A text of 10 001 characters in a previewThreadReplydropped

Implemented in 3

Tested by 6

Replaces

SwRS-MDOKFSTUDIO-REVIEW-178An inline thread change message carries valid lines and a non-blank text superseded superseded by SwRS-MDOKFSTUDIO-REVIEW-186, SwRS-MDOKFSTUDIO-REVIEW-192 Markdown file