Lhc_fl
(Linca)
12 Agosto, 2025 03:15
2
Lo revisé y encontré que el error debería estar en esta línea
let operation = OP.NONE;
const applyEmptyLines = opts && opts.applyEmptyLines;
return lines
.map((l) => {
if (!applyEmptyLines && l.length === 0) {
return l;
}
if (
operation !== OP.ADDED &&
l.slice(0, hlen) === hval &&
(tlen === 0 || l.slice(-tlen) === tail)
) {
operation = OP.REMOVED;
if (tlen === 0) {
const result = l.slice(hlen);
[hval, hlen] = getHead(head, hval);
return result;
} else if (l.slice(-tlen) === tail) {
No detecta las marcas a ambos lados, sino que solo detecta la marca de la derecha (final). Si aparece una marca en el lado derecho del texto seleccionado, entra en el bloque de eliminación
Esto significa que algo** se convertirá en lgo al presionar Ctrl + B
Hice un PR para solucionarlo
main ← Lhcfl:fix-applysurround
opened 03:11AM - 12 Aug 25 UTC
…d text
In the current Textarea Editor `applySurround`, only the right side i… s checked. That means if you write `something**`, pressing `Ctrl + B` will unexpectedly turn it into `mething`, since the `TextareaTextManipulation` detected the double asterisk `**` on the right and thought `something**` was the bold syntax, so it removed it.
This commit fixes the bug here.
Related meta topic: https://meta.discourse.org/t/-/358800
7 Me gusta