Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: heading render

Stevenbdc867d153b9
diff --git a/plugin/gomark/render/html/html.go b/plugin/gomark/render/html/html.go
index ca67a52e0..e8f4235a3 100644
--- a/plugin/gomark/render/html/html.go
+++ b/plugin/gomark/render/html/html.go
@@ -96,7 +96,7 @@ func (r *HTMLRender) renderCodeBlock(node *ast.CodeBlock) {
}
func (r *HTMLRender) renderHeading(node *ast.Heading) {
- element := fmt.Sprintf("<h%d>", node.Level)
+ element := fmt.Sprintf("h%d", node.Level)
r.output.WriteString(fmt.Sprintf("<%s>", element))
r.RenderNodes(node.Children)
r.output.WriteString(fmt.Sprintf("</%s>", element))
diff --git a/plugin/gomark/render/html/html_test.go b/plugin/gomark/render/html/html_test.go
index f497af459..d7a3409e0 100644
--- a/plugin/gomark/render/html/html_test.go
+++ b/plugin/gomark/render/html/html_test.go
@@ -18,6 +18,10 @@ func TestHTMLRender(t *testing.T) {
text: "Hello world!",
expected: `<p>Hello world!</p>`,
},
+ {
+ text: "# Hello world!",
+ expected: `<h1>Hello world!</h1>`,
+ },
{
text: "> Hello\n> world!",
expected: `<blockquote>Hello<br>world!</blockquote>`,