Skip to content

Commit fa3d2fa

Browse files
committed
Text wrap regexp: handle ¿¡ add the hyphen-minus and more quotation marks
1 parent 83540d8 commit fa3d2fa

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cocos2d/core/labelttf/CCLabelTTFCanvasRenderCmd.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ cc.LabelTTF.wrapInspection = true;
2626

2727
// These regular expressions consider a word any sequence of characters
2828
// from these Unicode (sub)blocks:
29-
// - Basic Latin (letters and numbers only, plus the hypen-minus '-')
30-
// - Latin-1 Supplement (accentuated letters only)
29+
// - Basic Latin (letters and numbers, plus the hypen-minus '-')
30+
// - Latin-1 Supplement (accentuated letters and ¿¡ only)
3131
// - Latin Extended-A (complete)
3232
// - Latin Extended-B (complete)
3333
// - IPA Extensions (complete)
@@ -36,13 +36,13 @@ cc.LabelTTF.wrapInspection = true;
3636
// - Greek and Coptic (complete, including reserved code points)
3737
// - Cyrillic (complete)
3838
// - Cyrillic Supplement (complete)
39-
// - General Punctuation (Non-Breaking Hyphen [U+2011] only*)
39+
// - General Punctuation (Non-Breaking Hyphen* [U+2011] and quotation marks)
4040
// * Note that Hyphen [U+2010] is considered a word boundary.
41-
cc.LabelTTF._wordRex = /([a-zA-Z0-9À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011]+|\S)/;
42-
cc.LabelTTF._symbolRex = /^[!,.:;}\]%\?>»\u2010]/;
43-
cc.LabelTTF._lastWordRex = /([a-zA-Z0-9À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011]+|\S)$/;
44-
cc.LabelTTF._lastEnglish = /[a-zA-Z0-9À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011]+$/;
45-
cc.LabelTTF._firsrEnglish = /^[a-zA-Z0-9À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011]/;
41+
cc.LabelTTF._wordRex = /([a-zA-Z0-9\-¿¡«À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011-]+|\S)/;
42+
cc.LabelTTF._symbolRex = /^[!,.:;}\]%\?>»\u2010--]/;
43+
cc.LabelTTF._lastWordRex = /([a-zA-Z0-9\-¿¡«À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011-]+|\S)$/;
44+
cc.LabelTTF._lastEnglish = /[a-zA-Z0-9\-¿¡«À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011-]+$/;
45+
cc.LabelTTF._firsrEnglish = /^[a-zA-Z0-9\-¿¡«À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011-]/;
4646

4747
(function () {
4848
cc.LabelTTF.RenderCmd = function () {

0 commit comments

Comments
 (0)