mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 20:14:35 -04:00
feat: add spell check (#2236)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
f68b3ff056
commit
1ff9e1f432
3 changed files with 25 additions and 6 deletions
|
@ -84,6 +84,7 @@ export const EditorPane: React.FC<ScrollProps> = ({ scrollState, onScroll, onMak
|
|||
const yjsExtension = useCodeMirrorYjsExtension(yText, awareness)
|
||||
const [firstEditorUpdateExtension, firstUpdateHappened] = useOnFirstEditorUpdateExtension()
|
||||
useInsertNoteContentIntoYTextInMockModeEffect(firstUpdateHappened, websocketConnection)
|
||||
const spellCheck = useApplicationState((state) => state.editorConfig.spellCheck)
|
||||
|
||||
// ToDo: Don't initialize new extension array here, instead refactor to global extension array
|
||||
const markdownExtensionsLinters = useMemo(() => {
|
||||
|
@ -114,7 +115,8 @@ export const EditorPane: React.FC<ScrollProps> = ({ scrollState, onScroll, onMak
|
|||
cursorActivityExtension,
|
||||
updateViewContext,
|
||||
yjsExtension,
|
||||
firstEditorUpdateExtension
|
||||
firstEditorUpdateExtension,
|
||||
EditorView.contentAttributes.of({ spellcheck: String(spellCheck) })
|
||||
],
|
||||
[
|
||||
linter,
|
||||
|
@ -124,7 +126,8 @@ export const EditorPane: React.FC<ScrollProps> = ({ scrollState, onScroll, onMak
|
|||
cursorActivityExtension,
|
||||
updateViewContext,
|
||||
yjsExtension,
|
||||
firstEditorUpdateExtension
|
||||
firstEditorUpdateExtension,
|
||||
spellCheck
|
||||
]
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue