mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-26 04:07:56 -05:00
Add <pokemonicon> and <itemicon> (#944)
This commit is contained in:
committed by
Guangcong Luo
parent
5c5c57870e
commit
41a9c54cfc
@@ -786,7 +786,16 @@ var Tools = {
|
||||
return {attribs: attribs};
|
||||
};
|
||||
return function (input) {
|
||||
return html.sanitizeWithPolicy(getString(input), tagPolicy);
|
||||
// Implement <pokemonicon> and <itemicon>
|
||||
input = getString(input).replace(/<(pokemon|item)icon>([^<]*)<\/\1icon>/g, function (match, p1, p2) {
|
||||
if (p1 === 'pokemon') {
|
||||
return '<span class="picon" style="display:inline-block;' + Tools.getPokemonIcon(p2) + '"></span>';
|
||||
} else if (p1 === 'item') {
|
||||
return '<span class="itemicon" style="display:inline-block;' + Tools.getItemIcon(p2) + '"></span>';
|
||||
}
|
||||
});
|
||||
|
||||
return html.sanitizeWithPolicy(input, tagPolicy);
|
||||
};
|
||||
})(),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user