Bug: WYSIWYG output uses nl2br(), causing extra and broken paragraph semant
-
Hi, I found an issue in ACF Text block rendering for WYSIWYG fields.
Current code in
inc/blocks/class-acf-text.php:
case ‘wysiwyg’:
$tag = ‘div’;
$value = wp_kses_post( nl2br( $field[‘value’] ) );
break;Problem:
–
nl2br()injects unnecessary around block-level HTML.
– WYSIWYG content (paragraphs/lists) can lose expected structure or get polluted output.Expected:
– WYSIWYG should be processed with ACF/WP content formatting (e.g.
apply_filters('acf_the_content', $value)), notnl2br().Repro:
1) Create ACF WYSIWYG field with multiple paragraphs
2) Render via ACF Field block (Text)
3) Frontend output contains extra / incorrect paragraph structure.
You must be logged in to reply to this topic.