Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 785 Bytes

File metadata and controls

42 lines (26 loc) · 785 Bytes

SingleBreak plugin for Craft CMS

SingleBreak is a twig filter that removes leading, trailing, duplicate and orphaned linebreaks in your paragraphs.

Installation

To install SingleBreak, follow these steps:

  1. Download & unzip the file and place the singlebreak sub-directory into your craft/plugins directory
  2. Install plugin in the Craft Control Panel under Settings > Plugins

SingleBreak works on Craft 2.5.x.

Usage

{{ someRichText | singlebreak }}

Example

The following rich text field output:

<p><br /></p>
<p><br />Lorem<br /><br/>ipsum<br /></p>
<p><br /></p>

turns into this:

<p>Lorem<br />ipsum</p>

Changelog

1.0.0 -- 2016.05.19

  • Initial release

Brought to you by Alexander Bech