Repository navigation
feat(text): add wpautop option to the_text helper - #199
Merged
Merged
Conversation
Align with BFF so textarea content can use paragraphs instead of nl2br double breaks. Co-authored-by: Cursor <cursoragent@cursor.com>
francoistibo
approved these changes
Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reprise / adaptation de la PR du BFF : BeAPI/beapi-frontend-framework#481
Contexte
Ajout du support de
wpautopdans le helperthe_text/get_the_text, utile pour les textarea (extrait, champs ACF, etc.) afin d’éviter les doubles<br>non conformes RGAA produits parnl2br.Voir wpautop().
Comportement
wpautop(défautfalse)wpautopàfalse: inchangé —esc_htmlpar défaut, pas dewpautopwpautopàtrue: si l’escape vaut encoreesc_html, il est remplacé parwp_kses_post, puiswpautop()sur la chaîne déjà assainiewpautopàtrue+ escape personnalisé : l’escape fourni est respectéis-style-*, les<p>générés à l’intérieur d’undivhéritent du style (car on n’a pas la main sur les<p>générés)Exemple
Test plan
the_text( $text )sanswpautopreste échappé enesc_html(comportement inchangé)the_text( $text, [ 'wpautop' => true ] )produit des<p>/<br />viawpautopet escape enwp_kses_post'escape' => 'wp_kses_post') avecwpautopest conservédiv.is-style-largeapplique le style typo aux<p>enfants sans classeis-style-*Made with Cursor
Note
Medium Risk
Touches HTML output/escaping and reorders the
bea_theme_framework_text_valuefilter relative towpautop, which could affect downstream filters; the broaddiv.is-style-* > pCSS may unintentionally restyle content if those wrappers are used widely.Reviewed by Cursor Bugbot for commit a210dcc. Bugbot is set up for automated code reviews on this repo. Configure here.