mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/editor-code-tabs] Correctly calculate end tag location
PHPBB3-11557
This commit is contained in:
parent
1e216319a7
commit
a1993bc074
1 changed files with 6 additions and 3 deletions
|
@ -441,10 +441,13 @@ function getCaretPosition(txtarea) {
|
||||||
}
|
}
|
||||||
if (lastStart == -1) return false;
|
if (lastStart == -1) return false;
|
||||||
|
|
||||||
|
if (start > 0)
|
||||||
|
{
|
||||||
for (i = 0; i < endTags.length; i++) {
|
for (i = 0; i < endTags.length; i++) {
|
||||||
index = value.lastIndexOf(endTags[i], start);
|
index = value.lastIndexOf(endTags[i], start - 1);
|
||||||
lastEnd = Math.max(lastEnd, index);
|
lastEnd = Math.max(lastEnd, index);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (lastEnd < lastStart);
|
return (lastEnd < lastStart);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue