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