Preserve shot text when adding markers
This commit is contained in:
@@ -90,7 +90,12 @@ function configure(node) {
|
||||
};
|
||||
const syncPrompt = (clip, value) => {
|
||||
const text = String(value || "");
|
||||
const marks = [...text.matchAll(/\[Shot\s+(\d+)\][^\n]*(?:\n|$)/gi)];
|
||||
// The shot description starts on the same line as the marker in the
|
||||
// CSGlide-style editor. Only consume the marker prefix through its
|
||||
// timestamp comma; consuming the whole line would discard text such
|
||||
// as `[Shot 1] At 00:00.000, the character walks...` when a new shot
|
||||
// is added and the marker scaffold is rebuilt.
|
||||
const marks = [...text.matchAll(/\[Shot\s+(\d+)\]\s+At\s+[^,\n]+,\s*/gi)];
|
||||
if (!marks.length) { if (clip.slots[0]) clip.slots[0].text = text.trim(); return; }
|
||||
marks.forEach((mark, index) => {
|
||||
const slotIndex = Number(mark[1]) - 1;
|
||||
|
||||
Reference in New Issue
Block a user