Skip to content

Commit a4b38ff

Browse files
committed
Fix <username> in custom HTML
If you were wondering, the recent ESLint 9 upgrade changed - from `<strong style="undefined;color:#307c6b">` - to `<strong style=";color:#307c6b">` and it turns out that the former passes Caja's CSS sanitization and the latter doesn't.
1 parent 5633336 commit a4b38ff

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

play.pokemonshowdown.com/src/battle-log.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -915,8 +915,7 @@ export class BattleLog {
915915
// <username> is a custom element that handles namecolors
916916
tagName = 'strong';
917917
const color = this.usernameColor(toID(getAttrib('name')));
918-
const style = getAttrib('style') || '';
919-
setAttrib('style', `${style};color:${color}`);
918+
unsanitizedStyle = `color:${color}`;
920919
} else if (tagName === 'spotify') {
921920
// <iframe src="https://open.spotify.com/embed/track/6aSYnCIwcLpnDXngGKAEzZ" width="300" height="380" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe>
922921
const src = getAttrib('src') || '';

0 commit comments

Comments
 (0)