Skip to content

Commit 71336b9

Browse files
committed
fix(classes): Make document state available during class's post init
1 parent 317a9ec commit 71336b9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

classes/base.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ function class:_init (options)
8686
end
8787

8888
function class:_post_init ()
89+
SILE.documentState.documentClass = self
8990
self._initialized = true
9091
for i, func in ipairs(self.deferredInit) do
9192
func(self)

inputters/base.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ function inputter:classInit (options)
3131
if constructor.id then
3232
SU.deprecated("std.object", "pl.class", "0.13.0", "0.14.0", string.format(_deprecated, constructor.id))
3333
end
34-
SILE.documentState.documentClass = constructor(options)
34+
-- Note SILE.documentState.documentClass is set by the instance's own :_post_init()
35+
constructor(options)
3536
end
3637

3738
function inputter:requireClass (tree)

0 commit comments

Comments
 (0)