diff --git a/core/modules/filter/src/FilterFormatEditForm.php b/core/modules/filter/src/FilterFormatEditForm.php
index 3ce6905..7ba09ec 100644
--- a/core/modules/filter/src/FilterFormatEditForm.php
+++ b/core/modules/filter/src/FilterFormatEditForm.php
@@ -33,9 +33,39 @@ public function form(array $form, FormStateInterface $form_state) {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
+    // "Flatten" submitted settings
+    $filters =& $form_state->getValue('filters');
+    foreach ($filters as &$filter) {
+      if (isset($filter['settings'])) {
+        $filter['settings'] = $this->flattenSettings($filter['settings']);
+      }
+    }
     parent::submitForm($form, $form_state);
     drupal_set_message($this->t('The text format %format has been updated.', array('%format' => $this->entity->label())));
     return $this->entity;
   }
 
+  /**
+   * "Flatten" an array of settings from the settings form.
+   *
+   * If a field on the filter configuration form is inside of e.g. a fieldset,
+   * that field's value will be at a corresponding level deep in the settings
+   * array. That will eventually cause an error as configuration options are
+   * expected to be all at the same level when saved.
+   *
+   * @param array $settings
+   *   An array of settings.
+   * @return array
+   *   An array of settings with only one layer of depth.
+   */
+  private function flattenSettings(array $settings) {
+    foreach ($settings as $key => $setting) {
+      if (is_array($setting)) {
+        $settings += $this->flattenSettings($setting);
+        unset($settings[$key]);
+      }
+    }
+    return $settings;
+  }
+
 }
