Merge branch 'MDL-55461_atto_equation' of git://github.com/davosmith/moodle

This commit is contained in:
Dan Poltawski 2017-01-09 10:51:23 +00:00
commit 1975dcf25c
4 changed files with 26 additions and 20 deletions

View File

@ -450,13 +450,15 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
while (equation.charAt(currentPos) === '\\' && currentPos >= 0) {
currentPos -= 1;
}
isChar = /[a-zA-Z\{\}]/;
isChar = /[a-zA-Z\{]/;
if (currentPos !== 0) {
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos - 1))) {
currentPos += 1;
if (equation.charAt(currentPos - 1) != '{') {
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos - 1))) {
currentPos += 1;
}
}
}
// Save the cursor position - for insertion from the library.

View File

@ -450,13 +450,15 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
while (equation.charAt(currentPos) === '\\' && currentPos >= 0) {
currentPos -= 1;
}
isChar = /[a-zA-Z\{\}]/;
isChar = /[a-zA-Z\{]/;
if (currentPos !== 0) {
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos - 1))) {
currentPos += 1;
if (equation.charAt(currentPos - 1) != '{') {
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos - 1))) {
currentPos += 1;
}
}
}
// Save the cursor position - for insertion from the library.

View File

@ -448,13 +448,15 @@ Y.namespace('M.atto_equation').Button = Y.Base.create('button', Y.M.editor_atto.
while (equation.charAt(currentPos) === '\\' && currentPos >= 0) {
currentPos -= 1;
}
isChar = /[a-zA-Z\{\}]/;
isChar = /[a-zA-Z\{]/;
if (currentPos !== 0) {
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos - 1))) {
currentPos += 1;
if (equation.charAt(currentPos - 1) != '{') {
// Now match to the end of the line.
while (isChar.test(equation.charAt(currentPos)) &&
currentPos < equation.length &&
isChar.test(equation.charAt(currentPos - 1))) {
currentPos += 1;
}
}
}
// Save the cursor position - for insertion from the library.