diff --git a/src/Form/GeshiFilterSettingsForm.php b/src/Form/GeshiFilterSettingsForm.php
index 8ad36aa..1b54303 100755
--- a/src/Form/GeshiFilterSettingsForm.php
+++ b/src/Form/GeshiFilterSettingsForm.php
@@ -18,8 +18,8 @@ use Drupal\Core\Url;
 
 use Drupal\Core\Cache\Cache;
 
-// Necessary for String::checkPlain().
-use Drupal\Component\Utility\String;
+// Necessary for SafeMarkup::checkPlain().
+use Drupal\Component\Utility\SafeMarkup;
 
 use \Drupal\geshifilter\GeshiFilter;
 
@@ -318,12 +318,12 @@ class GeshiFilterSettingsForm extends ConfigFormBase {
       '#type' => 'checkboxes',
       '#title' => t('Container tag style'),
       '#options' => array(
-        GeshiFilter::BRACKETS_ANGLE => '<code>' . String::checkPlain('<foo> ... </foo>') . '</code>',
-        GeshiFilter::BRACKETS_SQUARE => '<code>' . String::checkPlain('[foo] ... [/foo]') . '</code>',
-        GeshiFilter::BRACKETS_DOUBLESQUARE => '<code>' . String::checkPlain('[[foo]] ... [[/foo]]') . '</code>',
+        GeshiFilter::BRACKETS_ANGLE => '<code>' . SafeMarkup::checkPlain('<foo> ... </foo>') . '</code>',
+        GeshiFilter::BRACKETS_SQUARE => '<code>' . SafeMarkup::checkPlain('[foo] ... [/foo]') . '</code>',
+        GeshiFilter::BRACKETS_DOUBLESQUARE => '<code>' . SafeMarkup::checkPlain('[[foo]] ... [[/foo]]') . '</code>',
         GeshiFilter::BRACKETS_PHPBLOCK => t('PHP style source code blocks: !php and !percent', array(
-          '!php' => '<code>' . String::checkPlain('<?php ... ?>') . '</code>',
-          '!percent' => '<code>' . String::checkPlain('<% ... %>') . '</code>',
+          '!php' => '<code>' . SafeMarkup::checkPlain('<?php ... ?>') . '</code>',
+          '!percent' => '<code>' . SafeMarkup::checkPlain('<% ... %>') . '</code>',
         )),
       ),
       '#default_value' => $this->tagStyles(),
diff --git a/src/GeshiFilterProcess.php b/src/GeshiFilterProcess.php
index c3eeb03..59cf6f2 100644
--- a/src/GeshiFilterProcess.php
+++ b/src/GeshiFilterProcess.php
@@ -6,8 +6,8 @@
 
 namespace Drupal\geshifilter;
 
-// Necessary for String::checkPlain().
-use Drupal\Component\Utility\String;
+// Necessary for SafeMarkup::checkPlain().
+use Drupal\Component\Utility\SafeMarkup;
 
 /**
  * Helpers functions related to processing the source code with geshi.
@@ -92,7 +92,7 @@ class GeshiFilterProcess {
       // to mimic the 1.0.8 behavior, which is backward compatible.
       $code_class = "{$geshi->language} {$geshi->overall_class}";
       $source_code = '<span class="geshifilter"'
-        . (isset($title) ? ' title="' . String::checkPlain($title) . '"' : '')
+        . (isset($title) ? ' title="' . SafeMarkup::checkPlain($title) . '"' : '')
         . '><code class="' . $code_class . '">' . $geshi->parse_code() . '</code></span>';
     }
     else {
@@ -107,7 +107,7 @@ class GeshiFilterProcess {
         $geshi->start_line_numbers_at($linenumbers_start);
       }
       if (isset($title)) {
-        $source_code = '<div class="geshifilter-title">' . String::checkPlain($title) . '</div>';
+        $source_code = '<div class="geshifilter-title">' . SafeMarkup::checkPlain($title) . '</div>';
       }
       else {
         $source_code = '';
diff --git a/src/Plugin/Filter/GeshiFilterFilter.php b/src/Plugin/Filter/GeshiFilterFilter.php
index 6e75cf9..0cdd92a 100755
--- a/src/Plugin/Filter/GeshiFilterFilter.php
+++ b/src/Plugin/Filter/GeshiFilterFilter.php
@@ -11,8 +11,8 @@ namespace Drupal\geshifilter\Plugin\Filter;
 // Base class for filters.
 use Drupal\filter\Plugin\FilterBase;
 
-// Necessary for String::checkPlain().
-use Drupal\Component\Utility\String;
+// Necessary for SafeMarkup::checkPlain().
+use Drupal\Component\Utility\SafeMarkup;
 
 // Necessary for forms.
 use Drupal\Core\Form\FormStateInterface;
@@ -180,29 +180,29 @@ class GeshiFilterFilter extends FilterBase {
     $bracket_close = NULL;
     if (in_array(GeshiFilter::BRACKETS_ANGLE, $tag_styles)) {
       if (!$bracket_open) {
-        $bracket_open = String::checkPlain('<');
-        $bracket_close = String::checkPlain('>');
+        $bracket_open = SafeMarkup::checkPlain('<');
+        $bracket_close = SafeMarkup::checkPlain('>');
       }
-      $tag_style_examples[] = '<code>' . String::checkPlain('<foo>') . '</code>';
+      $tag_style_examples[] = '<code>' . SafeMarkup::checkPlain('<foo>') . '</code>';
     }
     if (in_array(GeshiFilter::BRACKETS_SQUARE, $tag_styles)) {
       if (!$bracket_open) {
-        $bracket_open = String::checkPlain('[');
-        $bracket_close = String::checkPlain(']');
+        $bracket_open = SafeMarkup::checkPlain('[');
+        $bracket_close = SafeMarkup::checkPlain(']');
       }
-      $tag_style_examples[] = '<code>' . String::checkPlain('[foo]') . '</code>';
+      $tag_style_examples[] = '<code>' . SafeMarkup::checkPlain('[foo]') . '</code>';
     }
     if (in_array(GeshiFilter::BRACKETS_DOUBLESQUARE, $tag_styles)) {
       if (!$bracket_open) {
-        $bracket_open = String::checkPlain('[[');
-        $bracket_close = String::checkPlain(']]');
+        $bracket_open = SafeMarkup::checkPlain('[[');
+        $bracket_close = SafeMarkup::checkPlain(']]');
       }
-      $tag_style_examples[] = '<code>' . String::checkPlain('[[foo]]') . '</code>';
+      $tag_style_examples[] = '<code>' . SafeMarkup::checkPlain('[[foo]]') . '</code>';
     }
     if (!$bracket_open) {
       drupal_set_message(t('Could not determine a valid tag style for GeSHi filtering.'), 'error');
-      $bracket_open = String::checkPlain('<');
-      $bracket_close = String::checkPlain('>');
+      $bracket_open = SafeMarkup::checkPlain('<');
+      $bracket_close = SafeMarkup::checkPlain('>');
     }
 
     if ($long) {
@@ -527,12 +527,12 @@ class GeshiFilterFilter extends FilterBase {
       '#type' => 'checkboxes',
       '#title' => t('Container tag style'),
       '#options' => array(
-        GeshiFilter::BRACKETS_ANGLE => '<code>' . String::checkPlain('<foo> ... </foo>') . '</code>',
-        GeshiFilter::BRACKETS_SQUARE => '<code>' . String::checkPlain('[foo] ... [/foo]') . '</code>',
-        GeshiFilter::BRACKETS_DOUBLESQUARE => '<code>' . String::checkPlain('[[foo]] ... [[/foo]]') . '</code>',
+        GeshiFilter::BRACKETS_ANGLE => '<code>' . SafeMarkup::checkPlain('<foo> ... </foo>') . '</code>',
+        GeshiFilter::BRACKETS_SQUARE => '<code>' . SafeMarkup::checkPlain('[foo] ... [/foo]') . '</code>',
+        GeshiFilter::BRACKETS_DOUBLESQUARE => '<code>' . SafeMarkup::checkPlain('[[foo]] ... [[/foo]]') . '</code>',
         GeshiFilter::BRACKETS_PHPBLOCK => t('PHP style source code blocks: !php and !percent', array(
-          '!php' => '<code>' . String::checkPlain('<?php ... ?>') . '</code>',
-          '!percent' => '<code>' . String::checkPlain('<% ... %>') . '</code>',
+          '!php' => '<code>' . SafeMarkup::checkPlain('<?php ... ?>') . '</code>',
+          '!percent' => '<code>' . SafeMarkup::checkPlain('<% ... %>') . '</code>',
         )),
       ),
       '#default_value' => $this->tagStyles(),
@@ -841,7 +841,7 @@ class GeshiFilterFilter extends FilterBase {
    * possible messing up by other filters, e.g.
    *   '[python]foo[/python]' to '[geshifilter-python]foo[/geshifilter-python]'.
    * Replaces newlines with "&#10;" to prevent issues with the line break filter
-   * Escapes the tricky characters like angle brackets with String::checkPlain()
+   * Escapes the tricky characters like angle brackets with SafeMarkup::checkPlain()
    * to prevent messing up by other filters like the HTML filter.
    *
    * @param array $match
@@ -894,7 +894,7 @@ class GeshiFilterFilter extends FilterBase {
     }
     // Return escaped code block.
     return '[geshifilter-' . $tag_name . $tag_attributes . ']'
-      . str_replace(array("\r", "\n"), array('', '&#10;'), String::checkPlain($content))
+      . str_replace(array("\r", "\n"), array('', '&#10;'), SafeMarkup::checkPlain($content))
       . '[/geshifilter-' . $tag_name . ']';
   }
 
@@ -909,7 +909,7 @@ class GeshiFilterFilter extends FilterBase {
       $match[2] = $this->unencode($match[2]);
     }
     return '[geshifilter-questionmarkphp]'
-    . str_replace(array("\r", "\n"), array('', '&#10;'), String::checkPlain($match[2]))
+    . str_replace(array("\r", "\n"), array('', '&#10;'), SafeMarkup::checkPlain($match[2]))
     . '[/geshifilter-questionmarkphp]';
   }
 
