Because custom markup and PHP fields often contain block-level XHTML, Views needs to know that the field should be treated as a block, not an inline, field in those cases. Otherwise, the field's contents will be output (by Views core) inside a 'span' element, which is invalid XHTML.

Refer to Views issue #298416: Span breaking XHTML strict.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

biwashingtonial’s picture

This patch is a quick fix. It outputs valid XHTML for non-inline fields, but it doesn't work for any use case requiring custom markup or PHP fields to display inline.

A better solution would implement element_type() in views_customfield_handler_field_markup and views_customfield_handler_field_phpcode to set the container element to 'div' or 'span' according to the specific contents of the field.