mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Prevent props being added as HTML attributes (#35739)
This commit is contained in:
parent
4cabc031e6
commit
bf15b1d65d
1 changed files with 3 additions and 7 deletions
|
|
@ -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 }} />;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue