Implemented proper conversion of links to local markdown files into html links

This commit is contained in:
Daniel Fichtinger 2024-11-24 17:47:08 -05:00
parent 46e4f483f6
commit 7915a4bb09
7 changed files with 92 additions and 28 deletions

15
internal/util/util.go Normal file
View file

@ -0,0 +1,15 @@
package util
import "strings"
func NormalizeContent(content string) string {
var normalized []string
lines := strings.Split(content, "\n")
for _, line := range lines {
line = strings.TrimSpace(line)
if line != "" {
normalized = append(normalized, line)
}
}
return strings.Join(normalized, "\n")
}