aboutsummaryrefslogtreecommitdiff
path: root/src/lexer
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-04-16 16:37:12 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2026-04-16 16:37:12 +0200
commitc76b6669517aeb0f0453a0abf6e2b17e50588792 (patch)
tree68d7802b5ded46be8461ea92f96a585e278e1ef4 /src/lexer
parent4229f1ef1d1a1fcc0476d2b13472c355d8f7d101 (diff)
feat(lexer): kind for math and code block
Diffstat (limited to 'src/lexer')
-rw-r--r--src/lexer/lexed.zig2
-rw-r--r--src/lexer/lexer.zig4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lexer/lexed.zig b/src/lexer/lexed.zig
index c47030a..cb3a4b7 100644
--- a/src/lexer/lexed.zig
+++ b/src/lexer/lexed.zig
@@ -7,7 +7,9 @@ pub const Kind = enum {
title,
quote,
code,
+ code_block,
math,
+ math_block,
image,
link,
bold,
diff --git a/src/lexer/lexer.zig b/src/lexer/lexer.zig
index 034f134..873d40b 100644
--- a/src/lexer/lexer.zig
+++ b/src/lexer/lexer.zig
@@ -87,8 +87,8 @@ pub const Lexer = struct {
if (is('#', 6, rune, acc)) return .{ .kind = .title };
if (isIn(links, rune, acc, before, .link)) return .{ .kind = .link };
if (isOneOrThree(":", rune, acc, .ref, .callout)) |it| return it;
- if (isOneOrThree("$", rune, acc, .math, .math)) |it| return it;
- if (isOneOrThree("`", rune, acc, .code, .code)) |it| return it;
+ if (isOneOrThree("$", rune, acc, .math, .math_block)) |it| return it;
+ if (isOneOrThree("`", rune, acc, .code, .code_block)) |it| return it;
return .{ .kind = .literal };
}
};