test logs
This commit is contained in:
@@ -192,6 +192,11 @@ export const TextInput = React.forwardRef(function TextInputImpl(
|
||||
newRt.detectFacetsWithoutResolution()
|
||||
setRichText(newRt)
|
||||
|
||||
console.log({
|
||||
utf8Length: newRt.length,
|
||||
utf16Length: newText.length,
|
||||
})
|
||||
|
||||
if (newRt.facets) {
|
||||
for (const facet of newRt.facets) {
|
||||
for (const feature of facet.features) {
|
||||
|
||||
@@ -15,6 +15,10 @@ export function addLinkCardIfNecessary({
|
||||
prevAddedLinks: Set<string>
|
||||
byteEnd: number
|
||||
}) {
|
||||
console.log({
|
||||
byteIndex: byteEnd,
|
||||
})
|
||||
|
||||
const utf16Index = utf8IndexToUtf16Index(newText, byteEnd)
|
||||
// Because we always trim the whitespace at the end of the text
|
||||
newText = newText + ' '
|
||||
@@ -28,6 +32,11 @@ export function addLinkCardIfNecessary({
|
||||
toAdd = 1
|
||||
}
|
||||
|
||||
console.log({
|
||||
utf8Index: byteEnd,
|
||||
utf16Index: utf16Index,
|
||||
})
|
||||
|
||||
if (!mayBePaste && utf16Index + toAdd !== cursorLocation) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user