PluginProbe
Code Snippets / 4.0.0-beta.2
Code Snippets v4.0.0-beta.2
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
← All changes | js/services/settings/editor-preview.ts +5 -0 3.10.2 → 4.0.0-beta.2 View file →
@@ -1,4 +1,5 @@
1 +import { __ } from '@wordpress/i18n'
1 2 import '../../entries/editor'
2 3
3 4 const parseSelect = (select: HTMLSelectElement) => select.options[select.selectedIndex].value
4 5 const parseCheckbox = (checkbox: HTMLInputElement) => checkbox.checked
@@ -9,8 +10,12 @@
9 10 const textarea = document.getElementById('code_snippets_editor_preview')
10 11
11 12 if (textarea && codeEditor) {
12 13 window.code_snippets_editor_preview = codeEditor.initialize(textarea)
14 +
15 + // CodeMirror's own input is unlabelled; name it so the preview reads as what it is.
16 + window.code_snippets_editor_preview.codemirror.getInputField().setAttribute('aria-label', __('Code editor preview', 'code-snippets'))
17 +
13 18 return window.code_snippets_editor_preview.codemirror
14 19 }
15 20
16 21 console.error('Could not initialise CodeMirror on textarea.', textarea)