aboutsummaryrefslogtreecommitdiff
path: root/mardown/ast_header.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-10-02 19:52:38 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-10-02 19:52:38 +0200
commit94dceb4f7c1740de9215b36ec183f93ca4337ee7 (patch)
tree5ad184efb0b74dd3aa4da7585f88a3e3f6cb4ecc /mardown/ast_header.go
parent8b249c9ce8bd1c351daf80c6c9b095fb1bccafe2 (diff)
style(markdown): fix typo in package name
Diffstat (limited to 'mardown/ast_header.go')
-rw-r--r--mardown/ast_header.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/mardown/ast_header.go b/mardown/ast_header.go
deleted file mode 100644
index 0ce8a22..0000000
--- a/mardown/ast_header.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package mardown
-
-import (
- "errors"
- "fmt"
- "html/template"
-)
-
-var ErrInvalidHeader = errors.New("invalid header")
-
-type astHeader struct {
- level uint
- content *astParagraph
-}
-
-func (a *astHeader) Eval() (template.HTML, *ParseError) {
- if a.level > 6 {
- return "", &ParseError{lxs: lexers{}, internal: ErrInvalidCodeFormat}
- }
- var content template.HTML
- content, err := a.content.Eval()
- if err != nil {
- return "", err
- }
- return template.HTML(fmt.Sprintf("<h%d>%s</h%d>", a.level, trimSpace(content), a.level)), nil
-}
-
-func header(lxs *lexers) (*astHeader, *ParseError) {
- b := &astHeader{level: uint(len(lxs.Current().Value))}
- if !lxs.Next() {
- return nil, &ParseError{lxs: *lxs, internal: ErrInvalidHeader}
- }
- var err *ParseError
- b.content, err = paragraph(lxs, true)
- if err != nil {
- return nil, err
- }
- return b, nil
-}