diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
index 21803ce..d684627 100644
--- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
+++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
@@ -1214,7 +1214,7 @@ public function renderText($alter) {
     // alterations made by this method. Any alterations or replacements made
     // within this method need to ensure that at the minimum the result is
     // XSS admin filtered. See self::renderAltered() as an example that does.
-    $value_is_safe = $this->last_render instanceof MarkupInterface;
+    $value_is_safe = $this->last_render instanceof MarkupInterface || (string) $this->last_render === '';
     // Cast to a string so that empty checks and string functions work as
     // expected.
     $value = (string) $this->last_render;
diff --git a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
index 9672dc2..b3a9a04 100644
--- a/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
@@ -264,15 +264,20 @@ public function testRenderTrimmedWithMoreLink() {
    * @covers ::renderText
    */
   public function testRenderNoResult() {
-    $this->setupDisplayWithEmptyArgumentsAndFields();
-    $field = $this->setupTestField(['empty' => 'This <strong>should work</strong>.']);
-    $field->field_alias = 'key';
-    $row = new ResultRow(['key' => '']);
+    foreach ([TRUE, FALSE] as $hide_alter_empty) {
+      $this->setupDisplayWithEmptyArgumentsAndFields();
+      $field = $this->setupTestField([
+        'empty' => 'This <strong>should work</strong>.',
+        'hide_alter_empty' => $hide_alter_empty,
+      ]);
+      $field->field_alias = 'key';
+      $row = new ResultRow(['key' => '']);
 
-    $expected_result = 'This <strong>should work</strong>.';
-    $result = $field->advancedRender($row);
-    $this->assertEquals($expected_result, $result);
-    $this->assertInstanceOf('\Drupal\views\Render\ViewsRenderPipelineMarkup', $result);
+      $expected_result = 'This <strong>should work</strong>.';
+      $result = $field->advancedRender($row);
+      $this->assertEquals($expected_result, $result);
+      $this->assertInstanceOf('\Drupal\views\Render\ViewsRenderPipelineMarkup', $result);
+    }
   }
 
   /**
