[MediaWiki-commits] [Gerrit] (bug 49386) Add support for ′ and ″ to the globeCoordinate p... - change (mediawiki...DataValues)
Tpt has uploaded a new change for review. https://gerrit.wikimedia.org/r/67966 Change subject: (bug 49386) Add support for ′ and ″ to the globeCoordinate parser .. (bug 49386) Add support for ′ and ″ to the globeCoordinate parser Change-Id: I1da162d5892de0498faaa1fc3bab97431398b297 --- M DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js M DataValues/resources/globeCoordinate.js/tests/globeCoordinate.parser.tests.js 2 files changed, 9 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/66/67966/1 diff --git a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js index 3b7387c..52f4ab7 100644 --- a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js +++ b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js @@ -451,7 +451,7 @@ if (result3 !== null) { result4 = parse_integer(); if (result4 !== null) { - if (input.charCodeAt(pos) === 39) { + if (input.charCodeAt(pos) === 39 || input.charCodeAt(pos) === 8242) { //' and ′ result5 = '; pos++; } else { @@ -490,24 +490,27 @@ result8 = parse_postdot(); if (result8 !== null) { result9 = []; - if (/^[']/.test(input.charAt(pos))) { + var quoteIds = [34, 39, 8242, 8243]; //, ', ′ and ″ + if (quoteIds.indexOf(input.charCodeAt(pos)) !== -1) { +console.log(input.charAt(pos)); result10 = input.charAt(pos); pos++; } else { result10 = null; if (reportFailures === 0) { - matchFailed(['\]); + matchFailed(['\′″]); } } while (result10 !== null) { result9.push(result10); - if (/^[']/.test(input.charAt(pos))) { + if (quoteIds.indexOf(input.charCodeAt(pos)) !== -1) { +console.log(input.charAt(pos)); result10 = input.charAt(pos); pos++; } else { result10 =
[MediaWiki-commits] [Gerrit] (bug 49386) Add support for ′ and ″ to the globeCoordinate p... - change (mediawiki...DataValues)
jenkins-bot has submitted this change and it was merged. Change subject: (bug 49386) Add support for ′ and ″ to the globeCoordinate parser .. (bug 49386) Add support for ′ and ″ to the globeCoordinate parser Change-Id: I1da162d5892de0498faaa1fc3bab97431398b297 --- M DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js M DataValues/resources/globeCoordinate.js/tests/globeCoordinate.parser.tests.js 2 files changed, 7 insertions(+), 5 deletions(-) Approvals: Tobias Gritschacher: Looks good to me, approved jenkins-bot: Verified diff --git a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js index aaef6b7..0e63e25 100644 --- a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js +++ b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js @@ -451,7 +451,7 @@ if (result3 !== null) { result4 = parse_integer(); if (result4 !== null) { - if (input.charCodeAt(pos) === 39) { + if (input.charCodeAt(pos) === 39 || input.charCodeAt(pos) === 8242) { //' and ′ result5 = '; pos++; } else { @@ -490,24 +490,25 @@ result8 = parse_postdot(); if (result8 !== null) { result9 = []; - if (/^[']/.test(input.charAt(pos))) { + var quoteIds = [34, 39, 8242, 8243]; //, ', ′ and ″ + if (quoteIds.indexOf(input.charCodeAt(pos)) !== -1) { result10 = input.charAt(pos); pos++; } else { result10 = null; if (reportFailures === 0) { - matchFailed(['\]); + matchFailed(['\′″]); } } while (result10 !== null) { result9.push(result10); - if (/^[']/.test(input.charAt(pos))) { + if (quoteIds.indexOf(input.charCodeAt(pos)) !== -1) { result10 = input.charAt(pos); pos++; } else { result10 = null;
[MediaWiki-commits] [Gerrit] (bug 49386) Add support for ′ and ″ to the globeCoordinate p... - change (mediawiki...DataValues)
Tobias Gritschacher has uploaded a new change for review. https://gerrit.wikimedia.org/r/67973 Change subject: (bug 49386) Add support for ′ and ″ to the globeCoordinate parser .. (bug 49386) Add support for ′ and ″ to the globeCoordinate parser Change-Id: I1da162d5892de0498faaa1fc3bab97431398b297 --- M DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js M DataValues/resources/globeCoordinate.js/tests/globeCoordinate.parser.tests.js 2 files changed, 7 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/73/67973/1 diff --git a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js index aaef6b7..0e63e25 100644 --- a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js +++ b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js @@ -451,7 +451,7 @@ if (result3 !== null) { result4 = parse_integer(); if (result4 !== null) { - if (input.charCodeAt(pos) === 39) { + if (input.charCodeAt(pos) === 39 || input.charCodeAt(pos) === 8242) { //' and ′ result5 = '; pos++; } else { @@ -490,24 +490,25 @@ result8 = parse_postdot(); if (result8 !== null) { result9 = []; - if (/^[']/.test(input.charAt(pos))) { + var quoteIds = [34, 39, 8242, 8243]; //, ', ′ and ″ + if (quoteIds.indexOf(input.charCodeAt(pos)) !== -1) { result10 = input.charAt(pos); pos++; } else { result10 = null; if (reportFailures === 0) { - matchFailed(['\]); + matchFailed(['\′″]); } } while (result10 !== null) { result9.push(result10); - if (/^[']/.test(input.charAt(pos))) { + if (quoteIds.indexOf(input.charCodeAt(pos)) !== -1) { result10 = input.charAt(pos); pos++; } else { result10 = null;
[MediaWiki-commits] [Gerrit] (bug 49386) Add support for ′ and ″ to the globeCoordinate p... - change (mediawiki...DataValues)
jenkins-bot has submitted this change and it was merged. Change subject: (bug 49386) Add support for ′ and ″ to the globeCoordinate parser .. (bug 49386) Add support for ′ and ″ to the globeCoordinate parser Change-Id: I1da162d5892de0498faaa1fc3bab97431398b297 --- M DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js M DataValues/resources/globeCoordinate.js/tests/globeCoordinate.parser.tests.js 2 files changed, 7 insertions(+), 5 deletions(-) Approvals: Tobias Gritschacher: Looks good to me, approved jenkins-bot: Verified diff --git a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js index aaef6b7..0e63e25 100644 --- a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js +++ b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js @@ -451,7 +451,7 @@ if (result3 !== null) { result4 = parse_integer(); if (result4 !== null) { - if (input.charCodeAt(pos) === 39) { + if (input.charCodeAt(pos) === 39 || input.charCodeAt(pos) === 8242) { //' and ′ result5 = '; pos++; } else { @@ -490,24 +490,25 @@ result8 = parse_postdot(); if (result8 !== null) { result9 = []; - if (/^[']/.test(input.charAt(pos))) { + var quoteIds = [34, 39, 8242, 8243]; //, ', ′ and ″ + if (quoteIds.indexOf(input.charCodeAt(pos)) !== -1) { result10 = input.charAt(pos); pos++; } else { result10 = null; if (reportFailures === 0) { - matchFailed(['\]); + matchFailed(['\′″]); } } while (result10 !== null) { result9.push(result10); - if (/^[']/.test(input.charAt(pos))) { + if (quoteIds.indexOf(input.charCodeAt(pos)) !== -1) { result10 = input.charAt(pos); pos++; } else { result10 = null;