From 0695974353490a8d352e1dc3c7650ebebb991f02 Mon Sep 17 00:00:00 2001 From: zhanshi Date: Tue, 4 Mar 2025 19:58:47 +0100 Subject: [PATCH] list handling isn't great yet. commented out for now --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 09d4240..ccfd9a7 100644 --- a/main.go +++ b/main.go @@ -105,12 +105,12 @@ func renderMarkdown(content string) template.HTML { content = linkPattern.ReplaceAllString(content, `$1`) // Handle lists properly - content = ulPattern.ReplaceAllString(content, "
  • $1
  • ") - content = olPattern.ReplaceAllString(content, "
  • $1
  • ") - content = regexp.MustCompile(`(?m)(
  • .+?
  • )`).ReplaceAllString(content, "") - content = regexp.MustCompile(`(?m)(`).ReplaceAllString(content, "$1") - content = regexp.MustCompile(`(?m)(
  • .+?
  • )`).ReplaceAllString(content, "
      $1
    ") - content = regexp.MustCompile(`(?m)(
      (?:
    1. .+?
    2. )+)
    `).ReplaceAllString(content, "$1") + //content = ulPattern.ReplaceAllString(content, "
  • $1
  • ") + //content = olPattern.ReplaceAllString(content, "
  • $1
  • ") + //content = regexp.MustCompile(`(?m)(
  • .+?
  • )`).ReplaceAllString(content, "") + //content = regexp.MustCompile(`(?m)(`).ReplaceAllString(content, "$1") + //content = regexp.MustCompile(`(?m)(
  • .+?
  • )`).ReplaceAllString(content, "
      $1
    ") + //content = regexp.MustCompile(`(?m)(
      (?:
    1. .+?
    2. )+)
    `).ReplaceAllString(content, "$1") // Preserve paragraph structure without breaking inline elements paragraphPattern := regexp.MustCompile(`(?m)(^([^#<\n].+)$)\n?`)