How create editor that edits only a singleline?

I would like to create an editor in CodeMirror that only accepts a singleline of text, but with support for markdown.

So **bold**, *italics*, ~~strikethrough~~ would work, but no tables or headings.

Is there a general solution for singleline editor, or should I just remove every \n from EditorState?

You can use a change filter to block all changes that insert a newline, and rebind enter to do something else (or nothing).

1 Like