mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 13:30:25 +02:00
[feature/editor-code-tabs] Correctly calculate end tag location
PHPBB3-11557
This commit is contained in:
@@ -441,9 +441,12 @@ function getCaretPosition(txtarea) {
|
||||
}
|
||||
if (lastStart == -1) return false;
|
||||
|
||||
for (i = 0; i < endTags.length; i++) {
|
||||
index = value.lastIndexOf(endTags[i], start);
|
||||
lastEnd = Math.max(lastEnd, index);
|
||||
if (start > 0)
|
||||
{
|
||||
for (i = 0; i < endTags.length; i++) {
|
||||
index = value.lastIndexOf(endTags[i], start - 1);
|
||||
lastEnd = Math.max(lastEnd, index);
|
||||
}
|
||||
}
|
||||
|
||||
return (lastEnd < lastStart);
|
||||
|
Reference in New Issue
Block a user