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_paragraph.go | |
| parent | 7b2b9d312791fcf6f49a350f6887a2019d2730f7 (diff) | |
feat(markdown): code block and better handle of inline code
Diffstat (limited to 'mardown/ast_paragraph.go')
| -rw-r--r-- | mardown/ast_paragraph.go | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/mardown/ast_paragraph.go b/mardown/ast_paragraph.go index 6149c30..e9855a7 100644 --- a/mardown/ast_paragraph.go +++ b/mardown/ast_paragraph.go @@ -7,8 +7,7 @@ import ( ) var ( - ErrInvalidParagraph = errors.New("invalid paragraph") - ErrInvalidCodeBlockPosition = errors.Join(ErrInvalidParagraph, errors.New("invalid code block position")) + ErrInvalidParagraph = errors.New("invalid paragraph") ) type astParagraph struct { @@ -61,19 +60,12 @@ func paragraph(lxs *lexers, oneLine bool) (*astParagraph, error) { n = 0 //TODO: handle case lexerCode: - n = 0 - if len(lxs.Current().Value) == 3 { - if n == 0 { - return nil, ErrInvalidCodeBlockPosition - } - lxs.current-- // because we do not use it before the next - return tree, nil - } - mod, err := modifier(lxs) + b, err := code(lxs) if err != nil { return nil, err } - tree.content = append(tree.content, mod) + tree.content = append(tree.content, b) + return tree, nil } } return tree, nil |
