mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-21 06:21:03 +02:00
Escape single quotes in composer placeholder
Signed-off-by: Robin Townsend <robintown@tcakoi.dev>
This commit is contained in:
parent
bcc6c96030
commit
951570a97f
@ -219,7 +219,9 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
|
|||||||
};
|
};
|
||||||
|
|
||||||
private showPlaceholder() {
|
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");
|
this.editorRef.current.classList.add("mx_BasicMessageComposer_inputEmpty");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user