Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Strip paragraph tags filter

125 sites Security covered Drupal 10–11
View on drupal.org

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.

Depends on

Dependencies of the latest stable release

  • filter Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

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

Releases

Version Type Core Release date
1.1.0 Stable 10–11 May 8, 2025
1.0.1 Stable 8–11 May 8, 2025