feat!: drop TagImplOptions in favor of Tag classes (#839)

Remove tag-options-adapter and the registerTag object-literal overload.
Custom tags must extend Tag.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Yang Jun
2026-07-07 22:34:14 +08:00
co-authored by Cursor
parent 9aed43ab2b
commit f0b907bcf4
9 changed files with 99 additions and 87 deletions
+2 -5
View File
@@ -1,6 +1,7 @@
import { Liquid, Context, isFalsy } from '../../../src'
import { mock, restore } from '../../stub/mockfs'
import { drainStream } from '../../stub/stream'
import { IntendedRenderErrorTag } from '../../stub/tags'
import { resolve } from 'path'
describe('Liquid', function () {
@@ -231,11 +232,7 @@ describe('Liquid', function () {
'/root/error.html': 'A{%throwingTag%}B'
})
engine = new Liquid({ root: ['/root/'] })
engine.registerTag('throwingTag', {
render: function () {
throw new Error('intended render error')
}
})
engine.registerTag('throwingTag', IntendedRenderErrorTag)
})
afterEach(restore)
it('should render a simple value', async () => {