aboutsummaryrefslogtreecommitdiff
path: root/markdown/ast.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-12-13 17:15:47 +0000
committerAnhgelus Morhtuuzh <william@herges.fr>2025-12-13 17:15:47 +0000
commit62fa3f77e8215fdaaf72ddb9df4162e0d65148da (patch)
treedbf20dca933996cf253fe2d110d8381b0c407b2d /markdown/ast.go
parentae297bbd117835304b298e7d8a2f914111940e77 (diff)
parent48311424ba2eaac254864c008b6d18e8510f827d (diff)
Merge pull request '[Refactor] Replace manual DOM manipulation in markdown by cleaner one' (#2) from refactor/mardown-dom into main
Reviewed-on: https://git.anhgelus.world/anhgelus/small-web/pulls/2
Diffstat (limited to 'markdown/ast.go')
-rw-r--r--markdown/ast.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/markdown/ast.go b/markdown/ast.go
index 9c9816e..f409ccb 100644
--- a/markdown/ast.go
+++ b/markdown/ast.go
@@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"html/template"
- "strings"
)
var ErrUnkownLexType = errors.New("unkown lex type")
@@ -63,11 +62,11 @@ func getBlock(lxs *lexers, newLine bool) (block, *ParseError) {
var b block
var err *ParseError
switch lxs.Current().Type {
- case lexerHeader:
+ case lexerHeading:
if !newLine {
b, err = paragraph(lxs, false)
} else {
- b, err = header(lxs)
+ b, err = heading(lxs)
}
case lexerExternal:
if newLine && lxs.Current().Value == "![" {
@@ -107,7 +106,3 @@ func getBlock(lxs *lexers, newLine bool) (block, *ParseError) {
}
return b, err
}
-
-func trimSpace(s template.HTML) template.HTML {
- return template.HTML(strings.TrimSpace(string(s)))
-}