feat: full syntax for strftime, close #177

- strftime syntax: <flags><width><modifier><conversion>
- new conversions: %n, %t
- fixed conversions: %N
- flags: _ ^ - 0 # :
- modifiers: E, O (ignored)
This commit is contained in:
harttle
2019-12-15 02:28:33 +00:00
parent c69ad538d4
commit ba5ff3f41c
7 changed files with 368 additions and 253 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ describe('LiquidOptions#fs', function () {
engine = new Liquid({
root: '/root/',
fs
})
} as any)
})
it('should be used to read templates', function () {
return engine.renderFile('files/foo')
+2 -2
View File
@@ -18,8 +18,8 @@ describe('Liquid', function () {
})
it('should call plugin with Liquid', async function () {
const engine = new Liquid()
engine.plugin(function (Liquid) {
this.registerFilter('t', x => isFalsy(x))
engine.plugin(function () {
this.registerFilter('t', isFalsy)
})
const html = await engine.parseAndRender('{{false|t}}')
expect(html).to.equal('true')