refactor: Add default BuildContext if none provided in TranslateMarks function

This commit is contained in:
Max 2024-07-11 20:37:06 +08:00
parent 61205ced5f
commit a5e1b569be

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{}
}