diff --git a/src/components/views/rooms/BasicMessageComposer.tsx b/src/components/views/rooms/BasicMessageComposer.tsx index 1e0a639aac..2a909bdd26 100644 --- a/src/components/views/rooms/BasicMessageComposer.tsx +++ b/src/components/views/rooms/BasicMessageComposer.tsx @@ -219,7 +219,9 @@ export default class BasicMessageEditor extends React.Component }; 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"); }