Merge pull request #1 from RojjaCebolla/patch-1

Use tilde as shorthand for {cardname}
This commit is contained in:
Chris McGuire
2022-12-15 19:32:32 -06:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -217,7 +217,7 @@
<h5 class='margin-top'>Text Codes:</h5> <h5 class='margin-top'>Text Codes:</h5>
<div class='text-codes margin-bottom padding'> <div class='text-codes margin-bottom padding'>
<h5>Code</h5><h5>Result</h5> <h5>Code</h5><h5>Result</h5>
<h5>{cardname}</h5><h5>Inserts the name of the card</h5> <h5>{cardname}</h5><h5>Inserts the name of the card (or use a tilde: ~)</h5>
<h5>{-}</h5><h5>Inserts an em-dash</h5> <h5>{-}</h5><h5>Inserts an em-dash</h5>
<h5>{i}</h5><h5>Italicizes text</h5> <h5>{i}</h5><h5>Italicizes text</h5>
<h5>{/i}</h5><h5>Removes italicization</h5> <h5>{/i}</h5><h5>Removes italicization</h5>

View File

@@ -891,8 +891,8 @@ 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 = rawText.replace(/{cardname}/ig, getCardName()); rawText = rawText.replace(/{cardname}|~/ig, getCardName());
} }
if (document.querySelector('#info-artist').value == '') { if (document.querySelector('#info-artist').value == '') {
rawText = rawText.replace('\uFFEE{elemidinfo-artist}', ''); rawText = rawText.replace('\uFFEE{elemidinfo-artist}', '');