From 4d0d1420df0b5d81fed2390b0a81e68d84ca6db8 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Tue, 16 Jun 2026 10:52:07 -0400 Subject: [PATCH] fix: continuations liste/checkbox/ol preservent le texte apres curseur (+after) --- frontend/editor-poc.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/editor-poc.html b/frontend/editor-poc.html index d22d70e..3aa3783 100644 --- a/frontend/editor-poc.html +++ b/frontend/editor-poc.html @@ -1834,8 +1834,8 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig } else { // Continue checkbox e.preventDefault(); - ta.value = before + '\n' + indent + taskMatch[2] + ' [ ] '; - ta.setSelectionRange(ta.value.length, ta.value.length); + ta.value = before + '\n' + indent + taskMatch[2] + ' [ ] ' + after; + ta.setSelectionRange(before.length + taskMatch[2].length + 6, before.length + taskMatch[2].length + 6); } markDirty(); autoHeight(); updateLineNumbers(); return; @@ -1844,7 +1844,7 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig // Auto-increment ordered list e.preventDefault(); var num = parseInt(olMatch[2]) + 1; - ta.value = before + '\n' + olMatch[1] + num + '. '; + ta.value = before + '\n' + olMatch[1] + num + '. ' + after; ta.setSelectionRange(ta.value.length, ta.value.length); markDirty(); autoHeight(); updateLineNumbers(); return; @@ -1859,7 +1859,7 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig } else { // Continue bullet e.preventDefault(); - ta.value = before + '\n' + ulMatch[1] + ulMatch[2] + ' '; + ta.value = before + '\n' + ulMatch[1] + ulMatch[2] + ' ' + after; ta.setSelectionRange(ta.value.length, ta.value.length); } markDirty(); autoHeight(); updateLineNumbers();