diff --git a/appview/pages/pages.go b/appview/pages/pages.go --- a/appview/pages/pages.go +++ b/appview/pages/pages.go @@ -33,7 +33,6 @@ "github.com/bluesky-social/indigo/atproto/syntax" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" - "github.com/microcosm-cc/bluemonday" ) //go:embed templates/* static @@ -502,13 +501,12 @@ ext := filepath.Ext(params.ReadmeFileName) switch ext { case ".md", ".markdown", ".mdown", ".mkdn", ".mkd": + htmlString = p.rctx.Sanitize(htmlString) htmlString = p.rctx.RenderMarkdown(params.Readme) params.Raw = false - params.HTMLReadme = template.HTML(p.rctx.Sanitize(htmlString)) + params.HTMLReadme = template.HTML(htmlString) default: - htmlString = string(params.Readme) params.Raw = true - params.HTMLReadme = template.HTML(bluemonday.NewPolicy().Sanitize(htmlString)) } } diff --git a/appview/pages/templates/repo/index.html b/appview/pages/templates/repo/index.html --- a/appview/pages/templates/repo/index.html +++ b/appview/pages/templates/repo/index.html @@ -358,7 +358,7 @@ {{ end }} {{ define "repoAfter" }} - {{- if .HTMLReadme -}} + {{- if or .HTMLReadme .Readme -}}
{{- if .Raw -}}
-                        {{- .HTMLReadme -}}
+                        {{- .Readme -}}
                     
{{- else -}} {{ .HTMLReadme }}