Problem/Motivation

The display_builder_html text format used by the Textarea source does not allow <p> or <br>. CKEditor writes every paragraph as a <p>. The filter_html filter strips them, so all paragraphs render as one block of text.

Steps to reproduce

  1. Add a Textarea source in the builder.
  2. Type two paragraphs, or a line break with Shift+Enter.
  3. Check the preview or the published output: the text runs together.

Proposed resolution

  • Add <br> <p> to allowed_html in config/optional/filter.format.display_builder_html.yml.
  • Add a post update for existing sites. It adds only the missing tags and skips sites that already allowed them or deleted the format.
  • Document the one-time change in docs/textarea.md.

Remaining tasks

  • Review.

User interface changes

None.

API changes

None.

Data model changes

New post update display_builder_post_update_allow_paragraphs_in_textarea_format() changes the stored display_builder_html format config.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mogtofu33 created an issue. See original summary.

  • mogtofu33 committed da92fda0 on 1.0.x
    fix: #3626751 Allow paragraphs and line breaks in the Textarea text...
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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