Description
exp:search:search_results excerpt tag displaying “xhtml” (as in the field formatting choice) when there are fewer than 50 words to display AND the textarea (or other field) is within a Fluid field and followed by a Grid.
Fluid Field
- text area (with fewer than 50 words to display)
- grid
We have a fluid field and within it is a textarea followed by a grid field.
Since EE’s Channel settings only show the fluid field as a Search excerpt choice, we couldn’t select the textarea field specifically. When there’s not enough text in the textarea, EE is merging its content with the next field-type in the fluid field (in our case a grid) and it’s wrapping the grid's content with “xhtml” at the beginning and end.
I think this may have to do with how grid field data is stored, and that EE’s excerpt tag is stripping away html from the grid field that is exposing “xhtml”.
One solution could be changing the channel settings so that we can target a search excerpt field that's within a fluid field, that's also the first of that field type in the entry. So the first textarea, but not the second or third.
What we're doing as a workaround at the moment is using the streeng addon to remove the two "xhtml" instances bookending the search results.