trilium icon indicating copy to clipboard operation
trilium copied to clipboard

(Bug report) write math inline, the text panel will delete things that i wrote before

Open YHLpuyu opened this issue 2 years ago • 4 comments

Trilium Version

0.54.2

What operating system are you using?

Windows

What is your setup?

Local (no sync)

Operating System Version

windows 10 21H2

Description

in textnote, when there have some math inline. the content wrote before is deleted by trilium, an can't redo with ctrl+z. That's a disaster for a notion app. in dev panel , it shows many error: Uncaught error: Message: Uncaught CKEditorError: model-nodelist-offset-out-of-bounds {"offset":206,"nodeList":[{"attributes":{"equation":"V_{i_2}","type":"span","display":false},"name":"mathtex-inline"},{"data":"An "},{"attributes":{"italic":true},"data":"ear of a polygon"},{"data":" is a triangle formed by three consecutive vertices "}]} Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-model-nodelist-offset-out-of-bounds, URL: , Line: 6, Column: 349970, Error object: {"name":"CKEditorError","context":[{"attributes":{"equation":"V_{i_2}","type":"span","display":false},"name":"mathtex-inline"},{"data":"An "},{"attributes":{"italic":true},"data":"ear of a polygon"},{"data":" is a triangle formed by three consecutive vertices "}],"data":{"offset":206,"nodeList":[{"attributes":{"equation":"V_{i_2}","type":"span","display":false},"name":"mathtex-inline"},{"data":"An "},{"attributes":{"italic":true},"data":"ear of a polygon"},{"data":" is a triangle formed by three consecutive vertices "}]}}, Stack: CKEditorError: model-nodelist-offset-out-of-bounds {"offset":206,"nodeList":[{"attributes":{"equation":"V_{i_2}","type":"span","display":false},"name":"mathtex-inline"},{"data":"An "},{"attributes":{"italic":true},"data":"ear of a polygon"},{"data":" is a triangle formed by three consecutive vertices "}]} Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-model-nodelist-offset-out-of-bounds at Wa.offsetToIndex (<anonymous>:6:495042) at Ua.offsetToIndex (<anonymous>:6:496022) at Ka (<anonymous>:6:506512) at ja._previous (<anonymous>:6:499232) at ja.next (<anonymous>:6:498175) at <anonymous>:6:638790 at _d.modifySelection (<anonymous>:6:638927) at _d.<anonymous> (<anonymous>:6:361677) at _d.fire (<anonymous>:6:351884) at _d.<computed> [as modifySelection] (<anonymous>:6:361729) Uncaught CKEditorError: model-nodelist-offset-out-of-bounds {"offset":206,"nodeList":[{"attributes":{"equation":"V_{i_2}","type":"span","display":false},"name":"mathtex-inline"},{"data":"An "},{"attributes":{"italic":true},"data":"ear of a polygon"},{"data":" is a triangle formed by three consecutive vertices "}]} Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-model-nodelist-offset-out-of-bounds at Wa.offsetToIndex (<anonymous>:6:495042) at Ua.offsetToIndex (<anonymous>:6:496022) at Ka (<anonymous>:6:506512) at ja._previous (<anonymous>:6:499232) at ja.next (<anonymous>:6:498175) at <anonymous>:6:638790 at _d.modifySelection (<anonymous>:6:638927) at _d.<anonymous> (<anonymous>:6:361677) at _d.fire (<anonymous>:6:351884) at _d.<computed> [as modifySelection] (<anonymous>:6:361729) the content I write is below, some content has been deleted :

An ear of a polygon is a triangle formed by three consecutive vertices  \(V_{i_0}\)\(V_{i_1}\), and  \(V_{i_2}\) for which  \(V_{i_1}\) is a  \(convex\)  \(vertex\). At such a vertex, the interior angle at the vertex is smaller than  \(\pi\) radians and the line segment from  \(V_{i_0}\)

YHLpuyu avatar Sep 07 '22 12:09 YHLpuyu

lxs

YHLpuyu avatar Sep 07 '22 12:09 YHLpuyu

I just experienced this not 30 seconds ago and was about to report it :sweat_smile:

For now I'm just typing on a new line then backspacing the new line once I'm done. Maybe that will help temporarily.

sigaloid avatar Sep 07 '22 12:09 sigaloid

I quit, and start using markdown files in folder. I don't want lose content.

YHLpuyu avatar Sep 13 '22 01:09 YHLpuyu

Even though the issue is 'closed', I don't think that the problem is actually solved. Maybe we should reopen it? @zadam Though I just tried to reproduce it and didn't succeed so far.

XXXJetfireXXX avatar Sep 16 '22 07:09 XXXJetfireXXX

I have the same issue. Any progress? I don't want to lose my content.

sindzicat avatar Nov 27 '22 16:11 sindzicat

Here, how to fix error "model-nodelist-offset-out-of-bounds" in ckeditor docs: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/tutorials/implementing-an-inline-widget.html#fixing-position-mapping

sindzicat avatar Nov 27 '22 16:11 sindzicat

Hi, is this reproducible on https://jsfiddle.net/isaul32/3wjrkLdv/ ? (the ckeditor5-math's demo)

zadam avatar Nov 27 '22 23:11 zadam