You are here

protected static function CodeMirrorPluginTrait::normalizeMode in The CodeMirror Editor 8

Normalizes language mode.

Parameters

string $mode: Language mode to normalize.

Return value

string Normalized language mode.

3 calls to CodeMirrorPluginTrait::normalizeMode()
CodeMirrorEditor::process in src/Plugin/Filter/CodeMirrorEditor.php
Performs the filter processing.
CodemirrorEditorFormatter::viewElements in src/Plugin/Field/FieldFormatter/CodemirrorEditorFormatter.php
Builds a renderable array for a field value.
CodeMirrorEditorWidget::formElement in src/Plugin/Field/FieldWidget/CodeMirrorEditorWidget.php
Returns the form for a single field widget.

File

src/CodeMirrorPluginTrait.php, line 180

Class

CodeMirrorPluginTrait
Provides a helper methods to for CodeMirror plugins.

Namespace

Drupal\codemirror_editor

Code

protected static function normalizeMode($mode) {
  return \Drupal::service('plugin.manager.codemirror_mode')
    ->normalizeMode($mode);
}