fix: ignore trailing whitespace in bracketed file links

This commit is contained in:
CJ van den Berg 2025-09-09 12:41:21 +02:00
parent 04951e7e9b
commit 000aaf9685
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -24,7 +24,7 @@ pub fn parse(link: []const u8) error{InvalidFileLink}!Dest {
if (std.mem.lastIndexOfScalar(u8, link, '(')) |pos| blk: { if (std.mem.lastIndexOfScalar(u8, link, '(')) |pos| blk: {
for (link[pos + 1 ..]) |c| switch (c) { for (link[pos + 1 ..]) |c| switch (c) {
'0'...'9', ',', ')', ':' => continue, '0'...'9', ',', ')', ':', ' ' => continue,
else => break :blk, else => break :blk,
}; };
return parse_bracket_link(link); return parse_bracket_link(link);