aboutsummaryrefslogtreecommitdiff
path: root/mardown/ast_header.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-09-30 17:40:27 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-09-30 17:40:27 +0200
commitbaccf109b9d7eb7e95f084579eaea7b6d88b782b (patch)
treed8908415f92828ef4de568280ed67833536a7e03 /mardown/ast_header.go
parentc40941359d46468ecd0b71919e34a1c481c7bee2 (diff)
feat(markdown): ast for literal and line break
support header in header
Diffstat (limited to 'mardown/ast_header.go')
-rw-r--r--mardown/ast_header.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/mardown/ast_header.go b/mardown/ast_header.go
index 540f47f..c7bc85d 100644
--- a/mardown/ast_header.go
+++ b/mardown/ast_header.go
@@ -16,8 +16,14 @@ func header(lxs lexers) (block, error) {
if err != nil {
return nil, err
}
+ // if this is a header, just consider it as literal #
if h, ok := bl.(*astHeader); ok {
- //TODO: handle
+ var s string
+ for range h.level {
+ s += "#"
+ }
+ b.content = append(b.content, astLiteral(s))
+ b.content = append(b.content, h.content...)
}
b.content = append(b.content, bl)
}