aboutsummaryrefslogtreecommitdiff
path: root/src/parser.zig
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-04-19 21:18:54 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2026-04-19 21:18:54 +0200
commitfe3e8fe67b7f655699be321796af70d4bdff230f (patch)
tree4aa194ade2c306720805dea76761bf608b70c06e /src/parser.zig
parent6aafc90f32d014390b29b77c6d53575793255847 (diff)
feat(ast): parse link
Diffstat (limited to 'src/parser.zig')
-rw-r--r--src/parser.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parser.zig b/src/parser.zig
index f109a88..7419c2e 100644
--- a/src/parser.zig
+++ b/src/parser.zig
@@ -5,10 +5,11 @@ const Lexer = @import("lexer/Lexer.zig");
const Element = @import("dom/Element.zig");
const paragraph = @import("paragraph.zig");
const title = @import("title.zig");
+const link = @import("link.zig");
pub const Error = error{
FeatureNotSupported,
-} || Lexer.Error || paragraph.Error || title.Error;
+} || Lexer.Error || paragraph.Error || title.Error || link.Error;
pub fn parse(parent: Allocator, content: []const u8) Error![]const u8 {
var arena = std.heap.ArenaAllocator.init(parent);
@@ -20,7 +21,7 @@ pub fn parse(parent: Allocator, content: []const u8) Error![]const u8 {
var l = try Lexer.init(content);
base: while (l.nextKind()) |it| {
try elements.append(alloc, switch (it) {
- .literal, .bold, .italic, .code => try paragraph.parse(alloc, &l),
+ .literal, .bold, .italic, .code, .link => try paragraph.parse(alloc, &l),
.title => try title.parse(alloc, &l),
.weak_delimiter, .strong_delimiter => {
var v = (try l.next(alloc)).?;