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; if (reportFailures === 0) { - matchFailed("['\"]"); + matchFailed("['\"′″]"); } } } diff --git a/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.parser.tests.js b/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.parser.tests.js index fdbf6cc..2fc547c 100644 --- a/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.parser.tests.js +++ b/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.parser.tests.js @@ -20,6 +20,7 @@ '1.1 2': [1.1, 2, 0.1], '90° N 30.10°': [90, 30.1, 0.01], '0° 5\'N, 0° 0\' 10"E': [0.08333333333333333, 0.002777777777777778, 0.0002777777777777778], + '0° 5′N, 0° 0′ 10″E': [0.08333333333333333, 0.002777777777777778, 0.0002777777777777778], '5\'S': [-5, 0, 1], '1\' 1"': [1.0002777777777778, 0, 0.0002777777777777778], '1\' 1.1"': [1.0003055555555556, 0, 0.00002777777777777778], -- To view, visit https://gerrit.wikimedia.org/r/67966 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1da162d5892de0498faaa1fc3bab97431398b297 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Tpt <thoma...@hotmail.fr> Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits