From 8a0aeb0aa377d2009202dc3111f17f13cd9f22ce Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Sat, 16 Sep 2023 11:21:02 +0200 Subject: [PATCH] Fixed string position for escaped sequences. Fixes #886 --- strings.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings.go b/strings.go index 4da065b..08cbf7b 100644 --- a/strings.go +++ b/strings.go @@ -156,7 +156,7 @@ func step(str string, state *stepState, opts stepOptions) (cluster, rest string, } else if cluster[0] == '[' { // Starting closing sequence. // Swallow the first one. cluster, rest, state.boundaries, state.unisegState = uniseg.StepString(rest, preState) - state.grossLength = len(cluster) + state.grossLength += len(cluster) if cluster[0] == ']' { state.escapedTagState = etNone } else {