mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 13:14:58 +08:00
Merge pull request #5033 from robintown/escape-composer-placeholder
Escape single quotes in composer placeholder
This commit is contained in:
commit
5dd5d4922f
@ -219,7 +219,9 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
|
||||
};
|
||||
|
||||
private showPlaceholder() {
|
||||
this.editorRef.current.style.setProperty("--placeholder", `'${this.props.placeholder}'`);
|
||||
// escape single quotes
|
||||
const placeholder = this.props.placeholder.replace(/'/g, '\\\'');
|
||||
this.editorRef.current.style.setProperty("--placeholder", `'${placeholder}'`);
|
||||
this.editorRef.current.classList.add("mx_BasicMessageComposer_inputEmpty");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user