Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module provides a text filter that removes paragraph tags from content. This allows for inline editing of text where paragraph breaks are not desired.

Strip paragraph tags from a text format that otherwise requires them.

Features

This module provides an input filter that strips opening and closing paragraph tags (<p> and </p>) so that you can designate a text format for producing inline WYSIWYG-edited output.

For instance, you can make a three-part caption that will be rigidly formatted as a bold title followed by a caption that allows interior bold or italics but no paragraph breaks flowing into a credit that is always italicized and muted. The content editor can edit each part with CKEditor 5, but rather than being stuck with the paragraph tags for each section

Installation

Works with Drupal 8, 9, 10, and 11.

composer require 'drupal/strippfilter:^1'

Post-Installation

Go to Administration » Configuration » Content authoring » Text formats and editors (/admin/config/content/formats) and create or edit the format you want to make always-inline by enabling the Strip paragraph tags filter. Make certain this filter runs last.

Then for fields that should use this format, set allowed formats only to this format and in form display set the textarea to be only one or two lines.

Additional Requirements

No non-core requirements. Makes most sense with core CKEditor (CKEditor5), as the main use case is working around their stubborn insistence on forcing paragraph tags. (See github.com/ckeditor/ckeditor5/issues/762 for the stalled progress and alternate approaches.)

Pairs well with Textarea widget for text fields.

Similar projects

Probably plenty and they probably have more functionality.

Whether it is a bug or not Strip HTML tags filter cannot do this because the content between the tags gets removed too. So if you set it to strip p tags you get blank text, empty strings, back.

Supporting this Module

You can support Agaric's overall contributions to Drupal and a bit beyond by supporting Drutopia at opencollective.com/drutopia. Thanks!!

Community Documentation

Contributions welcome, the issue queue is always a good place to start.

Activity

Total releases
2
First release
May 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Release date
1.1.0 Stable May 8, 2025
1.0.1 Stable May 8, 2025