autodoc: fix tokenizer

This commit is contained in:
andrewkraevskii 2024-04-10 23:18:41 +03:00 committed by Andrew Kelley
parent 7fb5a0b18b
commit f7a76bdfe3

View file

@ -1540,7 +1540,7 @@ const InlineParser = struct {
iter.pos += 1;
return .{ .text = replacement };
};
const is_valid = iter.pos + cp_len < iter.content.len and
const is_valid = iter.pos + cp_len <= iter.content.len and
std.unicode.utf8ValidateSlice(iter.content[iter.pos..][0..cp_len]);
const cp_encoded = if (is_valid)
iter.content[iter.pos..][0..cp_len]