mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
feat(filters): add squish filter (#943)
This commit is contained in:
@@ -94,6 +94,7 @@ filters:
|
||||
sort: sort.html
|
||||
sort_natural: sort_natural.html
|
||||
split: split.html
|
||||
squish: squish.html
|
||||
strip: strip.html
|
||||
strip_html: strip_html.html
|
||||
strip_newlines: strip_newlines.html
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
title: squish
|
||||
---
|
||||
|
||||
{% since %}v10.28.0{% endsince %}
|
||||
|
||||
Removes leading and trailing whitespace from a string, and replaces every run of whitespace inside it with a single space.
|
||||
|
||||
Input
|
||||
```liquid
|
||||
{{ " Hello there,
|
||||
Major Tom. " | squish }}
|
||||
```
|
||||
|
||||
Output
|
||||
```text
|
||||
Hello there, Major Tom.
|
||||
```
|
||||
Reference in New Issue
Block a user