Skip to content

Commit

Permalink
Ensure all html templates are wrapped in single elements
Browse files Browse the repository at this point in the history
Fixes searching for "alpha"
  • Loading branch information
madelson committed Jun 21, 2024
1 parent 0a7ef74 commit 2007b67
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gallery/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ function cardTemplate(card) {
</a>
<div class="attribution">
${() => card.contributionInfo
? html`UWC version contributed by ${card.contributionInfo.contributor}
${() => artAttribution(card.showFront ? card.contributionInfo.front : card.contributionInfo.back)}`
? html`<div>UWC version contributed by ${card.contributionInfo.contributor}
${() => artAttribution(card.showFront ? card.contributionInfo.front : card.contributionInfo.back)}</div>`
: card.universesWithinImage ? 'Official Universes Within card'
: ''}
</div>
Expand All @@ -56,7 +56,7 @@ function cardTemplate(card) {
${() => card.showFront ? "BACK" : "FRONT"}
</a>`}
${() => card.contributionInfo &&
html`<a href="https://mtgcardbuilder.com/creator/?id=${(card.showFront ? card.contributionInfo.front : card.contributionInfo.back).mtgCardBuilderId}" target="_blank" title="Open in MTG Card Builder">
html`<a href="${() => "https://mtgcardbuilder.com/creator/?id=" + (card.showFront ? card.contributionInfo.front : card.contributionInfo.back).mtgCardBuilderId}" target="_blank" title="Open in MTG Card Builder">
MTG Card Builder
</a>`}
</div>
Expand All @@ -65,8 +65,8 @@ function cardTemplate(card) {

function artAttribution(face) {
return !face.artist ? ''
: face.isMtgArt ? html`<br/>MTG ART: <i><a href="${face.artUrl}" target="_blank" >${face.artName}</a></i> by ${face.artist}`
: html`<br/>ART: <i><a href="${face.artUrl}" target="_blank">${face.artName}</a></i> by <a href="${face.artistUrl}">${face.artist}</a>`;
: face.isMtgArt ? html`<span><br/>MTG ART: <i><a href="${face.artUrl}" target="_blank" >${face.artName}</a></i> by ${face.artist}</span>`
: html`<span><br/>ART: <i><a href="${face.artUrl}" target="_blank">${face.artName}</a></i> by <a href="${face.artistUrl}">${face.artist}</a></span>`;
}

function getImageUrl(card) {
Expand Down

0 comments on commit 2007b67

Please sign in to comment.