You are here

public function WebformMarkup::buildText in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformMarkup.php \Drupal\webform\Plugin\WebformElement\WebformMarkup::buildText()

Build an element as text element.

Parameters

array $element: An element.

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.

array $options: An array of options.

Return value

array A render array representing an element as text.

Overrides WebformMarkupBase::buildText

File

src/Plugin/WebformElement/WebformMarkup.php, line 39

Class

WebformMarkup
Provides a 'webform_markup' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function buildText(array $element, WebformSubmissionInterface $webform_submission, array $options = []) {
  if (isset($element['#markup'])) {
    $element['#markup'] = MailFormatHelper::htmlToText($element['#markup']);
  }
  return parent::buildText($element, $webform_submission, $options);
}