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.

Comments

nsciacca created an issue. See original summary.

nsciacca’s picture

Issue summary: View changes
omlx’s picture

OMG, 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.

sivaprasadc’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new205.83 KB

Hi,

The patch applied successfully and it solved the issue in my site. Thanks for the patch. Kindly commit this patch.

kevinquillen’s picture

This 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.

eelkeblok’s picture

Thanks, 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.

eelkeblok’s picture

Priority: Normal » Major

I'd say this is actually major, since AFAICT this is an incompatibility with the current minor version of Drupal.

etroid’s picture

Oof, 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.

  • azovsky committed 95b45df on 8.x-1.x
    Issue #3055286 by nsciacca: Text rendered using plain_text format when...
azovsky’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for updates!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sivaprasadc’s picture