The text that is rendered using Advanced Text Formatter with the configuration filter set to "Limit Allowed Tags" and the tags included "<p>" is rendering as plain text. This is because the element array "#type" is being set to "processed_text" and the "#format" defaults to "plain_text". This is redundant because the the case statement above that handles the filters already sends the text through a "check_markup" function using the selected '#format". Attaching a patch that changes the output array to just include a '#markup' key to pass along the $output.
Looks like this was working fine on my site until Drupal 8.7.1.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Reviewed.png | 205.83 KB | sivaprasadc |
| advanced-text-formatter-markup-fix.patch | 618 bytes | nsciacca |
Comments
Comment #2
nsciaccaComment #3
omlx commentedOMG, I spent more than week looking why my site is broken and showing
<p> <br>tags. Please fix this bug, it is nasty.I test the attached patched and it works fine with me.
Comment #4
sivaprasadc commentedHi,
The patch applied successfully and it solved the issue in my site. Thanks for the patch. Kindly commit this patch.
Comment #5
kevinquillen commentedThis also fixes a problem that makes the module somewhat difficult to configure. In some circumstances, it was outputting " " characters all over (using Selected Text Format), which is not in the source text. This patch also corrects that behavior.
Comment #6
eelkeblokThanks, ran into this after updating to 8.7 as well (mind you I came from 8.4 🤭, so that's not saying much). It appears plain text is now doing some escaping.
Comment #7
eelkeblokI'd say this is actually major, since AFAICT this is an incompatibility with the current minor version of Drupal.
Comment #8
etroid commentedOof, I've spent some debugging this before I came across this issue. Definitely a major issue that should be fixed ASAP. Thanks for the patch, it's working as expected.
Comment #10
azovsky commentedThanks for updates!
Comment #12
sivaprasadc commented