mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 22:10:41 -07:00
fix(strip_html): avoid infinite loop on unclosed openers
Change the stall guard from i === lt to i <= lt (GHSA-m7fp-h3p4-hr49). Document that strip_html output is not safe for HTML without escape. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -6,6 +6,10 @@ title: strip_html
|
||||
|
||||
Removes any HTML tags from a string.
|
||||
|
||||
{% note warn Not safe for HTML output %}
|
||||
This filter is **not** a sanitizer. Output may still contain `<` sequences (for example malformed tags without a closing `>`, same as [Shopify Liquid](https://shopify.dev/docs/api/liquid/filters/strip_html)). Do not write the result into HTML without also using [escape][escape], [escape_once][escape_once], or [`outputEscape: "escape"`][outputEscape].
|
||||
{% endnote %}
|
||||
|
||||
Input
|
||||
```liquid
|
||||
{{ "Have <em>you</em> read <strong>Ulysses</strong>?" | strip_html }}
|
||||
@@ -15,3 +19,7 @@ Output
|
||||
```text
|
||||
Have you read Ulysses?
|
||||
```
|
||||
|
||||
[escape]: ./escape.html
|
||||
[escape_once]: ./escape.html
|
||||
[outputEscape]: ../tutorials/options.html#outputEscape
|
||||
|
||||
Reference in New Issue
Block a user