aboutsummaryrefslogtreecommitdiff
path: root/mardown/ast.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-09-30 23:18:20 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-09-30 23:18:20 +0200
commit9e5734cf76585705e259ae6c3585980ce8b994c1 (patch)
tree70b7f4c10379bd1a60173322e7a3f4b804e3ac4d /mardown/ast.go
parent7b2b9d312791fcf6f49a350f6887a2019d2730f7 (diff)
feat(markdown): code block and better handle of inline code
Diffstat (limited to 'mardown/ast.go')
-rw-r--r--mardown/ast.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/mardown/ast.go b/mardown/ast.go
index eaafee6..3a16903 100644
--- a/mardown/ast.go
+++ b/mardown/ast.go
@@ -75,10 +75,13 @@ func getBlock(lxs *lexers, newLine bool) (block, error) {
b, err = paragraph(lxs, false)
}
case lexerCode:
- if newLine && len(lxs.Current().Value) == 3 {
- //TODO: handle
- } else {
+ if !newLine && len(lxs.Current().Value) == 3 {
+ return nil, ErrInvalidCodeBlockPosition
+ }
+ if len(lxs.Current().Value) == 1 {
b, err = paragraph(lxs, false)
+ } else {
+ b, err = code(lxs)
}
case lexerLiteral, lexerEscape, lexerModifier:
b, err = paragraph(lxs, false)