title: How to change the default HTML output of a Gutenberg block in WordPress?
body: <p>I'm trying to change the default HTML output of a Gutenberg block in WordPress 5.7. For example, the default output of a <code>core/Group</code> block with a paragraph inside is:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;wp-block-group&quot;&gt;
      &lt;div class=&quot;wp-block-group__inner-container&quot;&gt;
          &lt;p&gt;Lorem ipsum dolor sit amet.&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I would like to output something like this:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;table role=&quot;presentation&quot; class=&quot;my-own-custom-class&quot;&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;p&gt;Lorem ipsum dolor sit amet.&lt;/p&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  <p>I've tried using a custom filter on the <code>render_block_core/group</code> hook. But I seem to only be able to add content around what WordPress already outputs. Here’s an example:</p>
  <pre class="lang-php prettyprint-override"><code>function my_group_block_wrapper( $block_content, $block ) {
      $content  = '&lt;table role=&quot;presentation&quot; class=&quot;my-own-custom-class&quot;&gt;&lt;tr&gt;&lt;td&gt;' . $block_content . '&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;';
      return $content;
  }
  add_filter( 'render_block_core/group', 'my_group_block_wrapper', 10, 2 );
  </code></pre>
  <p>And here’s what I get:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;table role=&quot;presentation&quot; class=&quot;my-own-custom-class&quot;&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;div class=&quot;wp-block-group&quot;&gt;
                  &lt;div class=&quot;wp-block-group__inner-container&quot;&gt;
                      &lt;p&gt;Lorem ipsum dolor sit amet.&lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  <p>How do I get rid of the divs generated by WordPress?</p>