1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Desktop: #9870: Fixed command palette not properly showing non-latin-characters (#9916)

This commit is contained in:
pedr
2024-02-19 07:31:14 -03:00
committed by GitHub
parent 2aea7fcc25
commit 563b9d8f71
3 changed files with 24 additions and 6 deletions

View File

@@ -24,6 +24,12 @@ describe('string-utils', () => {
'dfasdf', '[', ']', { escapeHtml: true }, '[d]fas[d]f',
],
[['zzz'], 'zzz<img src=q onerror=eval("require(\'child_process\').exec(\'mate-calc\');");>', 'a', 'b', { escapeHtml: true }, 'azzzb&lt;img src=q onerror=eval(&quot;require(&apos;child_process&apos;).exec(&apos;mate-calc&apos;);&quot;);&gt;'],
[['a'], 'non-latin-chars-éão', '<span>', '</span>', { escapeHtml: true }, 'non-l<span>a</span>tin-ch<span>a</span>rs-&eacute;<span>&atilde;</span>o'],
[['o'], 'Abrir diretório de perfis > (openProfileDirectory)', '<span>', '</span>', { escapeHtml: true },
'Abrir diret<span>&oacute;</span>ri<span>o</span> de perfis &gt; (<span>o</span>penPr<span>o</span>fileDirect<span>o</span>ry)'],
[[], '<>"\'&', 'a', 'b', { escapeHtml: true }, '&lt;&gt;&quot;&apos;&amp;'],
[[], '<>"\'&', 'a', 'b', { escapeHtml: false }, '<>"\'&'],
[['a'], 'non-latin-chars-éão', '<<<', '>>>', { escapeHtml: false }, 'non-l<<<a>>>tin-ch<<<a>>>rs-é<<<ã>>>o'],
])('should surround keywords with strings (case %#)', (async (keywords, input, prefix, suffix, options, expected) => {
const actual = StringUtils.surroundKeywords(keywords, input, prefix, suffix, options);