Commit b9f22855 authored by Julian Pustkuchen's avatar Julian Pustkuchen
Browse files

Issue #3292881: drowl_paragraphs_type_markup content is treated as empty and...

Issue #3292881: drowl_paragraphs_type_markup content is treated as empty and not output at all, if it contains no visible text
parent fe9ab293
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
<?php

/**
 * Implements HOOK_preprocess_paragraph__TYPE().
 */
function drowl_paragraphs_type_markup_preprocess_paragraph__markup(&$variables) {
  // To ensure the markup is rendered even with empty region check,
  // we add the empty-check-workaround. Typically markup like Javascript
  // might not have visual output, but should be rendered anyway!
  if (!empty($variables['content']['field_paragraphs_markup'][0])) {
    $variables['content']['field_paragraphs_markup'][0]['#suffix'] .= '<span class="empty-check-workaround element-hidden">&nbsp;</span>';
  }
}