Merge pull request #677 from trheyi/main

refactor: Add default BuildContext if none provided in TranslateMarks…
This commit is contained in:
Max 2024-07-11 20:37:38 +08:00 committed by GitHub
commit 7584e32ff1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -290,6 +290,10 @@ func (page *Page) TranslateMarks(ctx *BuildContext, option *BuildOption, doc *go
return nil
}
if ctx == nil {
ctx = NewBuildContext(nil)
}
if ctx.translations == nil {
ctx.translations = []Translation{}
}