aboutsummaryrefslogtreecommitdiff
path: root/mardown/ast_header.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-10-01 09:43:06 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-10-01 09:43:06 +0200
commitc49daa8fe6fdcf1c7fab08ee32f1ff994979c401 (patch)
tree6ac743ddd35563893f92f2fcba73907657d36191 /mardown/ast_header.go
parentb07dd267fc10812f7e94bf6d9be08667537dd331 (diff)
fix(markdown): paragraph parse always skip one char
Diffstat (limited to 'mardown/ast_header.go')
-rw-r--r--mardown/ast_header.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/mardown/ast_header.go b/mardown/ast_header.go
index 28a0a25..64e47ad 100644
--- a/mardown/ast_header.go
+++ b/mardown/ast_header.go
@@ -27,6 +27,9 @@ func (a *astHeader) Eval() (template.HTML, error) {
func header(lxs *lexers) (*astHeader, error) {
b := &astHeader{level: uint(len(lxs.Current().Value))}
+ if !lxs.Next() {
+ return nil, ErrInvalidHeader
+ }
var err error
b.content, err = paragraph(lxs, true)
if err != nil {