[Glitch] Prevent props being added as HTML attributes

Port bf15b1d65d to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Echo
2025-08-11 14:00:35 +02:00
committed by Claire
parent 4d9150735a
commit fd2420891c

View File

@@ -38,11 +38,7 @@ export const EmojiHTML = <Element extends ElementType>(
if (isModernEmojiEnabled()) {
return <ModernEmojiHTML {...props} />;
}
const Wrapper = props.as ?? 'div';
return (
<Wrapper
{...props}
dangerouslySetInnerHTML={{ __html: props.htmlString }}
/>
);
const { as: asElement, htmlString, extraEmojis, ...rest } = props;
const Wrapper = asElement ?? 'div';
return <Wrapper {...rest} dangerouslySetInnerHTML={{ __html: htmlString }} />;
};