From de948492e8b38a79d5db9c506c1b7b82e86c6b12 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Sun, 26 Apr 2026 23:10:17 +0200 Subject: feat(): support code block --- src/parser.zig | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/parser.zig') diff --git a/src/parser.zig b/src/parser.zig index a5a49cd..c35d47f 100644 --- a/src/parser.zig +++ b/src/parser.zig @@ -7,10 +7,17 @@ const paragraph = @import("paragraph.zig"); const title = @import("title.zig"); const link = @import("link.zig"); const list = @import("list.zig"); +const code = @import("code.zig"); -pub const Error = error{ - FeatureNotSupported, -} || Lexer.Error || paragraph.Error || title.Error || link.Error || list.Error || link.ImageError || Allocator.Error; +pub const Error = error{FeatureNotSupported} || + Lexer.Error || + paragraph.Error || + title.Error || + link.Error || + list.Error || + link.ImageError || + code.Error || + Allocator.Error; pub const Document = struct { arena: std.heap.ArenaAllocator, @@ -56,6 +63,7 @@ fn gen(parent: Allocator, l: *Lexer) Error!Document { .list_ordored => try list.parseOrdored(alloc, l), .list_unordored => try list.parseUnordored(alloc, l), .image => try link.parseImage(alloc, l), + .code_block => try code.parse(alloc, l), .weak_delimiter, .strong_delimiter => { l.consume(); continue :base; -- cgit v1.2.3