diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-09-30 23:18:20 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-09-30 23:18:20 +0200 |
| commit | 9e5734cf76585705e259ae6c3585980ce8b994c1 (patch) | |
| tree | 70b7f4c10379bd1a60173322e7a3f4b804e3ac4d /mardown/ast.go | |
| parent | 7b2b9d312791fcf6f49a350f6887a2019d2730f7 (diff) | |
feat(markdown): code block and better handle of inline code
Diffstat (limited to 'mardown/ast.go')
| -rw-r--r-- | mardown/ast.go | 9 |
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) |
