Skip to content

Commit

Permalink
fix(editor): don't allow text outside the source code mode code block (
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue authored Jun 27, 2021
1 parent 65d341e commit 284e982
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 163 deletions.
1 change: 1 addition & 0 deletions packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@remirror/dev": "0.0.0-pr706.35",
"@remirror/extension-blockquote": "0.0.0-pr706.35",
"@remirror/extension-codemirror5": "0.0.0-pr706.35",
"@remirror/extension-doc": "0.0.0-pr706.35",
"@remirror/extension-hard-break": "0.0.0-pr706.35",
"@remirror/extension-heading": "0.0.0-pr706.35",
"@remirror/extension-horizontal-rule": "0.0.0-pr706.35",
Expand Down
6 changes: 5 additions & 1 deletion packages/editor/src/components/source-code/manager.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { DocExtension } from "@remirror/extension-doc"
import { useRemirror } from "@remirror/react"
import CodeMirror from "codemirror"

import { RinoCodeBlockExtension } from "../../extensions"

export function useSourceCodeRemirror() {
return useRemirror({
extensions: () => [new RinoCodeBlockExtension({ CodeMirror, defaultCodeMirrorConfig: { mode: "text/x-markdown" } })],
extensions: () => [
new DocExtension({ content: "codeMirror" }),
new RinoCodeBlockExtension({ CodeMirror, defaultCodeMirrorConfig: { mode: "text/x-markdown" } }),
],
})
}

Expand Down
Loading

0 comments on commit 284e982

Please sign in to comment.