From 9da071d471cdfc94e3d8d002d9fdec8450a80e80 Mon Sep 17 00:00:00 2001 From: Amy Worrall Date: Sun, 23 Feb 2025 17:02:45 +0000 Subject: [PATCH] Fix for UTF8 character counting in class names --- Sources/Element.swift | 2 +- Sources/String.swift | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/Element.swift b/Sources/Element.swift index 2a205fd8..27d93508 100644 --- a/Sources/Element.swift +++ b/Sources/Element.swift @@ -1158,7 +1158,7 @@ open class Element: Node { var inClass: Bool = false var start: Int = 0 for i in 0.. UTF8Char { + return self.utf8Array[i] + } + func substring(_ beginIndex: Int) -> String { return String.split(self, beginIndex, self.count-beginIndex) }