@@ -37,7 +37,7 @@ export default class SplitText {
3737 noBalance : false ,
3838 balanceRatio : 1 ,
3939 minLines : 1 ,
40- handleCJK : false ,
40+ handleCJT : false ,
4141 }
4242 ) {
4343 this . elements = toArray ( element ) ;
@@ -47,7 +47,7 @@ export default class SplitText {
4747 this . options . noAriaLabel = typeof this . options . noAriaLabel === 'boolean' ? this . options . noAriaLabel : false ;
4848 this . options . noBalance = typeof this . options . noBalance === 'boolean' ? this . options . noBalance : false ;
4949 this . options . minLines = typeof this . options . minLines === 'number' ? this . options . minLines : 1 ;
50- this . options . handleCJK = typeof this . options . handleCJK === 'boolean' ? this . options . handleCJK : false ;
50+ this . options . handleCJT = typeof this . options . handleCJT === 'boolean' ? this . options . handleCJT : false ;
5151 this . options . type = typeof this . options . type === 'string' ? this . options . type : 'lines' ;
5252 this . split ( ) ;
5353 }
@@ -269,14 +269,14 @@ export default class SplitText {
269269 replaceWords ( element , notByChars ) {
270270 Array . from ( element . getElementsByClassName ( 'word' ) ) . forEach ( ( el , i ) => {
271271 el . replaceWith ( this . words [ i ] ) ;
272- if ( el . __isCJK && notByChars ) {
272+ if ( el . __isCJT && notByChars ) {
273273 this . words [ i ] . innerHTML = this . words [ i ] . textContent ;
274274 }
275275 } ) ;
276276 }
277277
278- // CJK locales + Thai
279- isCJKChar ( char ) {
278+ // CJT locales + Thai
279+ isCJTChar ( char ) {
280280 return / [ \u4E00 - \u9FFF \u3400 - \u4DBF \u3040 - \u309F \u30A0 - \u30FF \uAC00 - \uD7AF \u0E00 - \u0E7F ] / . test ( char ) ;
281281 }
282282
@@ -292,7 +292,7 @@ export default class SplitText {
292292 allElements . push ( document . createTextNode ( wholeText [ 0 ] ) ) ;
293293 }
294294
295- if ( this . options . handleCJK && key === 'word' ) {
295+ if ( this . options . handleCJT && key === 'word' ) {
296296 // Split text into words first
297297 const words = contents . split ( / ( \s + ) / ) . filter ( Boolean ) ;
298298
@@ -307,14 +307,14 @@ export default class SplitText {
307307
308308 // Process each character in the word
309309 let currentWord = '' ;
310- let isCJKMode = false ;
310+ let isCJTMode = false ;
311311
312312 for ( let j = 0 ; j < word . length ; j ++ ) {
313313 const char = word [ j ] ;
314- const isCurrentCharCJK = this . isCJKChar ( char ) ;
314+ const isCurrentCharCJT = this . isCJTChar ( char ) ;
315315
316316 // Mode switch or end of word
317- if ( isCurrentCharCJK !== isCJKMode || j === word . length - 1 ) {
317+ if ( isCurrentCharCJT !== isCJTMode || j === word . length - 1 ) {
318318 // Add the current character to the word
319319 if ( j === word . length - 1 ) {
320320 currentWord += char ;
@@ -326,23 +326,23 @@ export default class SplitText {
326326 elements . push ( splitEl ) ;
327327 allElements . push ( splitEl ) ;
328328
329- // If it's CJK , split into individual characters
330- if ( isCJKMode ) {
331- splitEl . __isCJK = true ;
329+ // If it's CJT , split into individual characters
330+ if ( isCJTMode ) {
331+ splitEl . __isCJT = true ;
332332 this . chars . push ( ...this . splitElement ( splitEl , 'char' , '' , false ) ) ;
333333 }
334334 }
335335
336336 // Reset for next segment
337337 currentWord = j === word . length - 1 ? '' : char ;
338- isCJKMode = isCurrentCharCJK ;
338+ isCJTMode = isCurrentCharCJT ;
339339 } else {
340340 currentWord += char ;
341341 }
342342 }
343343 }
344344 } else {
345- // Regular handling for non-CJK text or when handleCJK is false
345+ // Regular handling for non-CJT text or when handleCJT is false
346346 if ( key === 'char' ) {
347347 // Use Array.from to properly split Unicode characters including emojis
348348 const chars = Array . from ( contents ) ;
0 commit comments