Does the summary area support input filters?
-
05-02-2021 - |
Question
I have noticed that text filters placed in the summary area don't seem to work, that the raw text appears in the summary info when posted in Twitter, Facebook and the like.
Is that some inherent problem in the summary area, or is it something like the Metatag filter that sends the unfiltered text directly to Twitter and Facebook?
I will check whether the Metatag output can be filtered in the mean time.
La solution
EDIT:
I'm sorry, you are correct. The built-in summary is just a summary and it does not support text filters. HTML in that field will be stripped.
This thread on Drupal.org says this won't be fixed until Drupal 9:
https://www.drupal.org/project/drupal/issues/1529188
The workaround is to create a new field called "Summary" and set its text format to the desired WYSIWYG format:
Then, manage the display of your content type to hide the new field from the Default view mode.
In the Teaser view mode, hide the Body field and show the Summary field instead.
The other solution is to edit the "Filtered HTML" text format to allow the <span>
tag and other HTML that you require.
Honestly, it's a bit ridiculous that you have to do this to get what you want. I guess it's just one more reason to look forward to Drupal 9!