Editing Template:WikiCard
Template page
More actions
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 1: | Line 1: | ||
<html><div class="grid-item wiki-card"> | |||
{{ | <a href="/w/</html>{{{1}}}<html>"> | ||
</html>{{#if:{{{2|}}}|<html><img src="</html>{{#tag:nowiki|{{{2}}}}}<html>" alt="</html>{{{1}}}<html>"></html>|}}<html> | |||
<div class="wiki-card-content"></html>{{{3|{{{1}}}}}}<html></div> | |||
</a> | |||
</div><html> | |||
<div class="grid-item wiki-card"> | <div class="grid-item wiki-card"> | ||
<a href="/w/</html>{{{1}}}<html>"> | <a href="/w/</html>{{{1}}}<html>"> | ||
| Line 13: | Line 17: | ||
} | } | ||
</style> | </style> | ||
</ | |||
<script> | |||
document.querySelectorAll('.wiki-card-content').forEach(el => { | |||
// Only process plain text nodes (avoid breaking existing HTML) | |||
if (el.children.length === 0) { | |||
const text = el.textContent.trim(); | |||
const parts = text.split(': '); | |||
if (parts.length > 1) { | |||
const first = parts.shift(); | |||
const rest = parts.join(': '); | |||
el.innerHTML = first + ': <span class="no-wrap">' + rest + '</span>'; | |||
} | |||
} | |||
}); | |||
</script></html> | |||