diff --git a/core/lib/Drupal/Component/Serialization/Yaml.php b/core/lib/Drupal/Component/Serialization/Yaml.php
index 7d0f0c5..5792375 100644
--- a/core/lib/Drupal/Component/Serialization/Yaml.php
+++ b/core/lib/Drupal/Component/Serialization/Yaml.php
@@ -32,7 +32,9 @@ public static function encode($data) {
    */
   public static function decode($raw) {
     try {
-      return Symfony::parse($raw, TRUE);
+      // If you have YAML data without a line break in it, like foo: bar then
+      // that will be misinterpreted as a filename.
+      return Symfony::parse(rtrim($raw) . "\n", TRUE);
     }
     catch (\Exception $e) {
       throw new InvalidDataTypeException($e->getMessage(), $e->getCode(), $e);
