only escape when the text is not empty

This commit is contained in:
Joe Williams
2022-10-21 23:54:12 +09:00
committed by GitHub
parent f39088dce0
commit 2e1001f802

View File

@@ -85,7 +85,7 @@ func (s *Stream) DrawBox(x, y, w, h int, color string, thickness int, kwargs ...
func (s *Stream) Drawtext(text string, x, y int, escape bool, kwargs ...KwArgs) *Stream {
AssertType(s.Type, "FilterableStream", "drawtext")
args := MergeKwArgs(kwargs)
if escape {
if escape && text != "" {
text = fmt.Sprintf("%q", text)
}
if text != "" {