From 0ad907be0145e9a784aa7fcf8546b32bf05bd1fe Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 20 Apr 2021 14:13:01 -0600 Subject: [PATCH] Support native spell checkers in codemirror editor #1266 --- CHANGELOG.md | 1 + .../grav/templates/forms/fields/codemirror/codemirror.html.twig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 171b862e..c9f43434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#improved) * Removed sourcemaps references from fork-awesome.min.css [#2122](https://github.com/getgrav/grav-plugin-admin/issues/2122) + * Support native spell checkers in CodeMirror editor [#1266](https://github.com/getgrav/grav-plugin-admin/issues/1266) 1. [](#bugfix) * Moved preset CSS compile to earlier in the process to ensure compilation happens in time. * Prevent Save actions from Flex Objects to trigger the unsaved unload notice [#2125](https://github.com/getgrav/grav-plugin-admin/issues/2125) diff --git a/themes/grav/templates/forms/fields/codemirror/codemirror.html.twig b/themes/grav/templates/forms/fields/codemirror/codemirror.html.twig index e2fc8442..adda62b3 100644 --- a/themes/grav/templates/forms/fields/codemirror/codemirror.html.twig +++ b/themes/grav/templates/forms/fields/codemirror/codemirror.html.twig @@ -1,7 +1,7 @@ {% extends "forms/fields/editor/editor.html.twig" %} {% set theme = config.plugins.admin.whitelabel.codemirror_theme ?? 'paper.css' %} {% set font = config.plugins.admin.whitelabel.codemirror_md_font ?? 'sans' %} -{% set codemirrorOptions = {'mode': 'gfm', 'theme': theme, 'font': font, 'ignore': []}|merge(field.codemirror|default({})) %} +{% set codemirrorOptions = {'spellcheck': 'true', 'inputStyle': 'contenteditable', 'mode': 'gfm', 'theme': theme, 'font': font, 'ignore': []}|merge(field.codemirror|default({})) %} {# backward compatibility #} {% if field.showPreview %}