mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
Merge "UnicodeJS treating start/end tags as letters"
This commit is contained in:
commit
17642a3f14
|
@ -23,6 +23,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGroup( chr ) {
|
function getGroup( chr ) {
|
||||||
|
// chr is always converted to a string by RegExp#test
|
||||||
|
// e.g. null -> 'null' and would match /[a-z]/
|
||||||
|
// so return null for any non-string value
|
||||||
|
if ( typeof chr !== 'string' ) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
var group;
|
var group;
|
||||||
for ( group in patterns ) {
|
for ( group in patterns ) {
|
||||||
if ( patterns[group].test( chr ) ) {
|
if ( patterns[group].test( chr ) ) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ QUnit.test( 'isBreak', function ( assert ) {
|
||||||
// 40 - 50
|
// 40 - 50
|
||||||
"汉字/漢字 c\u0300\u0327k" +
|
"汉字/漢字 c\u0300\u0327k" +
|
||||||
// 50 - 60
|
// 50 - 60
|
||||||
" c\u0300\u0327",
|
" c\u0300\u0327 a.",
|
||||||
/*jshint quotmark:single */
|
/*jshint quotmark:single */
|
||||||
textString = new unicodeJS.TextString( text ),
|
textString = new unicodeJS.TextString( text ),
|
||||||
breaks = [
|
breaks = [
|
||||||
|
@ -31,7 +31,7 @@ QUnit.test( 'isBreak', function ( assert ) {
|
||||||
21, 25, 30,
|
21, 25, 30,
|
||||||
31, 39, 40,
|
31, 39, 40,
|
||||||
41, 42, 43, 44, 45, 46, 50,
|
41, 42, 43, 44, 45, 46, 50,
|
||||||
51, 54
|
51, 54, 55, 56, 57
|
||||||
];
|
];
|
||||||
|
|
||||||
QUnit.expect( text.length + 1 );
|
QUnit.expect( text.length + 1 );
|
||||||
|
|
Loading…
Reference in a new issue