fix: perform utf-8 sanitazation on buffer insert_chars
This commit is contained in:
parent
9d6b760f03
commit
400af298d7
1 changed files with 4 additions and 1 deletions
|
@ -781,11 +781,14 @@ const Node = union(enum) {
|
|||
self_: *const Node,
|
||||
line_: usize,
|
||||
col_: usize,
|
||||
s: []const u8,
|
||||
chars: []const u8,
|
||||
allocator: Allocator,
|
||||
metrics_: Metrics,
|
||||
) !struct { usize, usize, Root } {
|
||||
var self = self_;
|
||||
var s = chars;
|
||||
if (!std.unicode.utf8ValidateSlice(chars))
|
||||
s = try unicode.utf8_sanitize(allocator, chars);
|
||||
const Ctx = struct {
|
||||
allocator: Allocator,
|
||||
col: usize,
|
||||
|
|
Loading…
Add table
Reference in a new issue