From 5b1ede8a25d3b62b45c9a1a88e9f6e4d0ce36610 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 16:30:04 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- internal/exporters/markdown.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/exporters/markdown.go b/internal/exporters/markdown.go index d66a849..ad342ed 100644 --- a/internal/exporters/markdown.go +++ b/internal/exporters/markdown.go @@ -40,19 +40,19 @@ func (e *MarkdownExporter) Export(course *models.Course, outputPath string) erro var buf bytes.Buffer // Write course header - buf.WriteString(fmt.Sprintf("# %s\n\n", course.Course.Title)) + fmt.Fprintf(&buf, "# %s\n\n", course.Course.Title) if course.Course.Description != "" { - buf.WriteString(fmt.Sprintf("%s\n\n", e.htmlCleaner.CleanHTML(course.Course.Description))) + fmt.Fprintf(&buf, "%s\n\n", e.htmlCleaner.CleanHTML(course.Course.Description)) } // Add metadata buf.WriteString("## Course Information\n\n") - buf.WriteString(fmt.Sprintf("- **Course ID**: %s\n", course.Course.ID)) - buf.WriteString(fmt.Sprintf("- **Share ID**: %s\n", course.ShareID)) - buf.WriteString(fmt.Sprintf("- **Navigation Mode**: %s\n", course.Course.NavigationMode)) + fmt.Fprintf(&buf, "- **Course ID**: %s\n", course.Course.ID) + fmt.Fprintf(&buf, "- **Share ID**: %s\n", course.ShareID) + fmt.Fprintf(&buf, "- **Navigation Mode**: %s\n", course.Course.NavigationMode) if course.Course.ExportSettings != nil { - buf.WriteString(fmt.Sprintf("- **Export Format**: %s\n", course.Course.ExportSettings.Format)) + fmt.Fprintf(&buf, "- **Export Format**: %s\n", course.Course.ExportSettings.Format) } buf.WriteString("\n---\n\n") @@ -60,15 +60,15 @@ func (e *MarkdownExporter) Export(course *models.Course, outputPath string) erro lessonCounter := 0 for _, lesson := range course.Course.Lessons { if lesson.Type == "section" { - buf.WriteString(fmt.Sprintf("# %s\n\n", lesson.Title)) + fmt.Fprintf(&buf, "# %s\n\n", lesson.Title) continue } lessonCounter++ - buf.WriteString(fmt.Sprintf("## Lesson %d: %s\n\n", lessonCounter, lesson.Title)) + fmt.Fprintf(&buf, "## Lesson %d: %s\n\n", lessonCounter, lesson.Title) if lesson.Description != "" { - buf.WriteString(fmt.Sprintf("%s\n\n", e.htmlCleaner.CleanHTML(lesson.Description))) + fmt.Fprintf(&buf, "%s\n\n", e.htmlCleaner.CleanHTML(lesson.Description)) } // Process lesson items