fix: strip html newline tags (#892)

* docs: add @talboren as financial contributor

* fix(strip_html): match tags that span newlines inside angle brackets

Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Yang Jun
2026-05-03 21:36:09 +08:00
committed by GitHub
co-authored by Cursor
parent a55f543f49
commit 26ea2856c7
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -77,5 +77,10 @@ describe('filters/html', function () {
it('should strip until empty', function () {
return test('{{"<br/><br />< p ></p></ p >" | strip_html }}', '')
})
it('should strip generic tags spanning ASCII newlines inside the tag', function () {
expect(liquid.parseAndRenderSync('{{"<img\nsrc=x\nonerror=alert(1)>" | strip_html}}')).toBe('')
expect(liquid.parseAndRenderSync('{{"<img\rsrc=x\ronerror=alert(1)>" | strip_html}}')).toBe('')
expect(liquid.parseAndRenderSync('{{"<svg\nonload=alert(1)>" | strip_html}}')).toBe('')
})
})
})