aboutsummaryrefslogtreecommitdiff
path: root/src/title.zig
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-04-19 17:55:42 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2026-04-19 17:55:42 +0200
commitcf6f08d1602841f8c337dc64365e2dcde1e4c528 (patch)
tree4e94b76fa7c035b2de9e983bab248063aef5a6b4 /src/title.zig
parent25fa85cbb622e1f9dc9818b0d18fe0de2ef7e5a3 (diff)
fix(ast): error if title contains modifier
Diffstat (limited to 'src/title.zig')
-rw-r--r--src/title.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/title.zig b/src/title.zig
index d9b5612..de88c67 100644
--- a/src/title.zig
+++ b/src/title.zig
@@ -18,7 +18,10 @@ pub fn parse(alloc: Allocator, l: *Lexer) Error!Element {
6 => "h6",
else => unreachable,
});
- try el.appendContent(try paragraph.parseContent(alloc, l));
+ try el.appendContent(paragraph.parseLine(alloc, l) catch |err| switch (err) {
+ paragraph.Error.IllegalPlacement => return Error.InvalidTitleContent,
+ else => return err,
+ });
v = (try l.next(alloc)) orelse return el;
if (!v.kind.isDelimiter()) return Error.InvalidTitleContent;
v.deinit();