sub-cli/internal/format/ass/formatter.go
2025-04-23 19:22:41 +08:00

17 lines
300 B
Go

package ass
import (
"fmt"
)
// Format 格式化ASS文件
func Format(filePath string) error {
// 读取ASS文件
assFile, err := Parse(filePath)
if err != nil {
return fmt.Errorf("解析ASS文件失败: %w", err)
}
// 写回格式化后的ASS文件
return Generate(assFile, filePath)
}