Improved inline markup.
This commit is contained in:
parent
06e9a6abbe
commit
cbbf34c271
2 changed files with 10 additions and 3 deletions
|
@ -186,7 +186,8 @@ class _i18nSingleton extends Spine.Module
|
|||
|
||||
# apply inline markup
|
||||
translated
|
||||
.replace(/\*(.+?)\*/gm, '<b>$1</b>')
|
||||
.replace(/\|\|(.+?)\|\|/gm, '<i>$1</i>')
|
||||
.replace(/\|(.+?)\|/gm, '<b>$1</b>')
|
||||
.replace(/_(.+?)_/gm, '<u>$1</u>')
|
||||
.replace(/§(.+?)§/gm, '<kbd>$1</kbd>')
|
||||
|
||||
|
|
|
@ -274,9 +274,12 @@ test( "i18n", function() {
|
|||
translated = App.i18n.translateContent('%s %s test', 123, 'xxx');
|
||||
equal( translated, '123 xxx test', 'de-de - %s %s' );
|
||||
|
||||
translated = App.i18n.translateContent('*%s* %s test', 123, 'xxx');
|
||||
translated = App.i18n.translateContent('|%s| %s test', 123, 'xxx');
|
||||
equal( translated, '<b>123</b> xxx test', 'de-de - *%s* %s' );
|
||||
|
||||
translated = App.i18n.translateContent('||%s|| %s test', 123, 'xxx');
|
||||
equal( translated, '<i>123</i> xxx test', 'de-de - *%s* %s' );
|
||||
|
||||
translated = App.i18n.translateContent('_%s_ %s test', 123, 'xxx');
|
||||
equal( translated, '<u>123</u> xxx test', 'de-de - _%s_ %s' );
|
||||
|
||||
|
@ -311,9 +314,12 @@ test( "i18n", function() {
|
|||
translated = App.i18n.translateContent('%s %s test', 123, 'xxx');
|
||||
equal( translated, '123 xxx test', 'en-us - %s %s' );
|
||||
|
||||
translated = App.i18n.translateContent('*%s* %s test', 123, 'xxx');
|
||||
translated = App.i18n.translateContent('|%s| %s test', 123, 'xxx');
|
||||
equal( translated, '<b>123</b> xxx test', 'en-us - *%s* %s' );
|
||||
|
||||
translated = App.i18n.translateContent('||%s|| %s test', 123, 'xxx');
|
||||
equal( translated, '<i>123</i> xxx test', 'en-us - *%s* %s' );
|
||||
|
||||
translated = App.i18n.translateContent('_%s_ %s test', 123, 'xxx');
|
||||
equal( translated, '<u>123</u> xxx test', 'en-us - _%s_ %s' );
|
||||
|
||||
|
|
Loading…
Reference in a new issue