Custom block automatically adds code when edited in admin I have written some HTML in custom block, but every time I open the editor in Drupal Admin UI some extra code is added to the block. Essentially, this means I have to remove the added code every time I want to edit the file which is becoming quite annoying. I am using Drupal 8 on the Acquia Cloud. Does anyone know what might be the cause of this?

Edit 1:

I'm using CKEditor

My HTML goes from this

 &lt;div&gt;
   &lt;div&gt;
     &lt;nav&gt;
       &lt;a&gt;
         &lt;img src=""/&gt;
         &lt;p&gt;Test&lt;/p&gt;
       &lt;/a&gt;
       &lt;button&gt;
         &lt;div&gt;&lt;/div&gt;
       &lt;/button&gt;
       &lt;div&gt;
         &lt;ul&gt;
           &lt;li&gt;&lt;a&gt;Sign In&lt;/a&gt;&lt;/li&gt;
           &lt;li&gt;&lt;a&gt;Sign up&lt;/a&gt;&lt;/li&gt;
         &lt;/ul&gt;
      &lt;/div&gt;
    &lt;/nav&gt;
  &lt;/div&gt;
&lt;/div&gt;


To this

&lt;div&gt;
  &lt;div&gt;
    &lt;nav&gt;
      &lt;a&gt;&lt;img alt="" data-entity-type="" data-entity-uuid="" src="" /&gt; &lt;/a&gt;
      &lt;p&gt;&lt;a&gt;Test&lt;/a&gt;&lt;/p&gt;
      &lt;a&gt;&lt;/a&gt;
      &lt;button&gt;&lt;/button&gt;

      &lt;div&gt; &lt;/div&gt;
      &lt;button&gt;&lt;/button&gt;

      &lt;div&gt;
       &lt;ul&gt;
         &lt;li&gt;&lt;a&gt;Sign In &lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a&gt;Sign up &lt;/a&gt;&lt;/li&gt;
       &lt;/ul&gt;
      &lt;/div&gt;
    &lt;/nav&gt;
  &lt;/div&gt;
&lt;/div&gt;


Edit 2:
I'm also getting the following code added to a second block

&lt;div class="menu-toggle-icon"&gt;&amp;nbsp;&lt;/div&gt;
&lt;button aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler" data-target="#navbarSupportedContent" data-toggle="collapse" type="button"&gt;&lt;/button&gt;
The data-entity-type &amp; data-entity-uuid properties are added with  WYSIWYG fields when you have the Track images uploaded via a Text Editor filter . This filter is designed to track usage of images as they are dropped into HTML body fields and update the fields accordingly when the image is updated.

To disable it, navigate to the Text formats and editors admin section and configure the format that's being used for your custom block. Untick the Track images uploaded via a Text Editor filter option and click the Save configuration button to disable the filter.