Add files via upload

changed the way spellnames are handled for the class list to allow japanese and other similar language characters
pre-0.4.4
Felix 2019-12-30 11:37:22 +01:00 committed by GitHub
parent 3ba7134bc6
commit 16846df323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
/** /**
* @author Felix Müller aka syl3r86 * @author Felix Müller aka syl3r86
* @version 0.1.3 * @version 0.1.4
*/ */
class SpellBrowser extends Application { class SpellBrowser extends Application {
@ -116,7 +116,8 @@ class SpellBrowser extends Application {
spell.compendium = pack.collection; spell.compendium = pack.collection;
// determining classes that can use the spell // determining classes that can use the spell
let cleanSpellName = spell.name.toLowerCase().replace(/[^a-zA-Z0-9\s:]/g, '').replace("'", '').replace(/ /g, ''); let cleanSpellName = spell.name.toLowerCase().replace(/[^一-龠ぁ-ゔァ-ヴーa-zA-Z0-9---9々〆〤]/g, '').replace("'", '').replace(/ /g, '');
//let cleanSpellName = spell.name.toLowerCase().replace(/[^a-zA-Z0-9\s:]/g, '').replace("'", '').replace(/ /g, '');
if (this.classList[cleanSpellName] !== undefined) { if (this.classList[cleanSpellName] !== undefined) {
let classes = this.classList[cleanSpellName]; let classes = this.classList[cleanSpellName];
spell.data.classes = classes.split(','); spell.data.classes = classes.split(',');