diff --git a/src/application/Application.mjs b/src/application/Application.mjs index 02961e9c..40a2bf2b 100644 --- a/src/application/Application.mjs +++ b/src/application/Application.mjs @@ -307,8 +307,8 @@ export default class Application extends Component { // Multiple events. for (let i = 0; i < n; i++) { const target = path[i]; - const events = isHorizontalDirection && target.rtl ? eventsRtl : eventsLtr; - const event = target._getMostSpecificHandledMember(events); + const targetEvents = isHorizontalDirection && target.rtl ? eventsRtl : eventsLtr; + const event = target._getMostSpecificHandledMember(targetEvents); if (event !== undefined) { const returnValue = target[event](...args); if (returnValue !== false) { diff --git a/src/textures/TextTokenizer.ts b/src/textures/TextTokenizer.ts index c5244f4a..d8576d6f 100644 --- a/src/textures/TextTokenizer.ts +++ b/src/textures/TextTokenizer.ts @@ -76,7 +76,7 @@ class TextTokenizer { // - first, matching all characters between space (32) and ~ (127) // - second, matching all unicode quotation marks (see https://hexdocs.pm/ex_unicode/Unicode.Category.QuoteMarks.html) // - third, matching the unicode en/em dashes (see https://en.wikipedia.org/wiki/Dash#Unicode) - return text.charAt(0) <= 'z' && !/[^ -~'-›–—]/.test(text); + return text.charAt(0) <= 'z' && !/[^ -~\u2018-\u201F\u2039\u203A\u2013\u2014]/.test(text); } /** diff --git a/src/textures/bidiTokenizer.ts b/src/textures/bidiTokenizer.ts index 8648006e..b1b53648 100644 --- a/src/textures/bidiTokenizer.ts +++ b/src/textures/bidiTokenizer.ts @@ -26,7 +26,7 @@ type Direction = 'lri' | 'rli' | 'fsi' | 'default'; // https://www.unicode.org/reports/tr9/ const reZeroWidthSpace = /[\u200B\u200E\u200F\u061C]/; -const reDirectionalFormat = /[\u202A\u202B\u202C\u202D\u202E\u202E\u2066\u2067\u2068\u2069]/; +const reDirectionalFormat = /[\u202A\u202B\u202C\u202D\u202E\u2066\u2067\u2068\u2069]/; const LRI = '\u2066'; // Left-to-Right Isolate ('ltr') const RLI = '\u2067'; // Right-to-Left Isolate ('rtl') diff --git a/tests/textures/test.text.js b/tests/textures/test.text.js index c4fe157e..3bd7416d 100644 --- a/tests/textures/test.text.js +++ b/tests/textures/test.text.js @@ -311,7 +311,6 @@ describe('text', function() { app.children = [element]; const texture = app.tag("Item").texture; stage.drawFrame(); - console.log(texture.source.renderInfo.lines); chai.assert(texture.source.renderInfo.lines.length === 3); chai.assert(getLineText(texture.source.renderInfo.lines[0]) === 'EXTRA-LONG-WORD'); }); @@ -330,7 +329,6 @@ describe('text', function() { app.children = [element]; const texture = app.tag("Item").texture; stage.drawFrame(); - console.log(texture.source.renderInfo.lines); chai.assert(texture.source.renderInfo.lines.length === 4); chai.assert(getLineText(texture.source.renderInfo.lines[0]) === 'Sit'); chai.assert(getLineText(texture.source.renderInfo.lines[1]) === 'EXTRA-LONG-WORD'); @@ -351,7 +349,6 @@ describe('text', function() { app.children = [element]; const texture = app.tag("Item").texture; stage.drawFrame(); - console.log(texture.source.renderInfo.lines); chai.assert(texture.source.renderInfo.lines.length === 9); chai.assert(getLineText(texture.source.renderInfo.lines[0]) === 'EXTR'); chai.assert(getLineText(texture.source.renderInfo.lines[1]) === 'A-LO'); @@ -374,7 +371,6 @@ describe('text', function() { app.children = [element]; const texture = app.tag("Item").texture; stage.drawFrame(); - console.log(texture.source.renderInfo.lines); chai.assert(texture.source.renderInfo.lines.length === 10); chai.assert(getLineText(texture.source.renderInfo.lines[0]) === 'Sit'); chai.assert(getLineText(texture.source.renderInfo.lines[1]) === 'EXTR');