Fix tilde card name replacement

The tilde replacement for card name doesn't work if the "{cardname}" tag isn't present because the if condition is incorrect.  This fixes the condition to check for either one.
This commit is contained in:
DorkmasterFlek
2023-02-09 16:30:13 -05:00
parent f7b1bf8f4d
commit 50072d24fb

View File

@@ -2286,7 +2286,7 @@ function writeText(textObject, targetContext) {
rawText = params.get('copyright'); //so people using CC for custom card games without WotC's IP can customize their copyright info rawText = params.get('copyright'); //so people using CC for custom card games without WotC's IP can customize their copyright info
if (rawText == 'none') { rawText = ''; } if (rawText == 'none') { rawText = ''; }
} }
if (rawText.toLowerCase().includes('{cardname}' || '~')) { if (rawText.toLowerCase().includes('{cardname}') || rawText.toLowerCase().includes('~')) {
rawText = rawText.replace(/{cardname}|~/ig, getCardName()); rawText = rawText.replace(/{cardname}|~/ig, getCardName());
} }
if (document.querySelector('#info-artist').value == '') { if (document.querySelector('#info-artist').value == '') {