fix: properly treat unicode blanks, fixes #221

This commit is contained in:
harttle
2020-04-28 20:55:30 +08:00
parent 2fa4edaa84
commit 673b015435
3 changed files with 27 additions and 4 deletions
+13
View File
@@ -0,0 +1,13 @@
import { Liquid } from '../..'
import { expect, use } from 'chai'
import * as chaiAsPromised from 'chai-as-promised'
use(chaiAsPromised)
describe('Issues', function () {
it('#221 unicode blanks are not properly treated', async () => {
const engine = new Liquid({ strictVariables: true, strictFilters: true })
const html = engine.parseAndRenderSync('{{huh | truncate: 11}}', { huh: 'fdsafdsafdsafdsaaaaa' })
expect(html).to.equal('fdsafdsa...')
})
})