Custom block build function to display wysiwyg body text I am learning to build custom blocks through a module. I am trying to get the build() function to work. I have the code and it works. However, if I edit the configuration of the block as a user it does not print the text in the text formatter.
'#markup' =&gt;
    '&lt;div&gt;' . $this-&gt;t('Body: @body', ['@body' =&gt; $this-&gt;configuration['body']]) . '&lt;/div&gt;',

In the rendered block on the page it prints... Body:
But not the text in the wysiwyg.
Any ideas how to get that to work. The tutorials and links I am finding are not relavant.
Assuming you store the block configuration via a text_format form element as in https://drupal.stackexchange.com/a/278811/47547
src/Plugin/Block/ExampleBlock.php
&lt;?php

namespace Drupal\mymodule\Plugin\Block;

use Drupal\Core\Block\BlockBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Provides an example block.
 *
 * @Block(
 *   id = &quot;mymodule_example&quot;,
 *   admin_label = @Translation(&quot;Example&quot;),
 *   category = @Translation(&quot;mymodule&quot;)
 * )
 */
class ExampleBlock extends BlockBase {

  public function blockForm($form, FormStateInterface $form_state) {
    $body = !empty($this-&gt;configuration['body']) ? $this-&gt;configuration['body'] : [];
    $form['body'] = [
      '#type' =&gt; 'text_format',
      '#title' =&gt; 'Body',
      '#format' =&gt; isset($body['format']) ? $body['format'] : 'full_html',
      '#default_value' =&gt; isset($body['value']) ? $body['value'] : '',
    ];
    return $form;
  }

  public function blockSubmit($form, FormStateInterface $form_state) {
    $this-&gt;configuration['body'] = $form_state-&gt;getValue('body');
  }

You would output the wysiwyg content via processed_text:
  public function build() {
    $build = [
      '#type' =&gt; 'container',
      'label' =&gt; ['#markup' =&gt; 'Body: '],
    ];
    if (!empty($this-&gt;configuration['body'])) {
      $build['body'] = [
        '#type' =&gt; 'processed_text',
        '#text' =&gt; $this-&gt;configuration['body']['value'],
        '#format' =&gt; $this-&gt;configuration['body']['format'],
      ];
    }
    return $build;
  }

}