I am getting some strange issues with the insertion point getting wrongly positioned. It seems to happen after I have done some complex editing operations, The program gets confused about where to insert new text.
For example, you put the cursor on one line and the text that you type is inserted several lines above it. Switching to 'Source code mode' and back doesn't fix it.
I will try to capture a sample file that illustrates the issue. So far it occurs intermittently and is difficult to pin down. Has anyone else noticed this?
I have done some testing and got a better handle on this. Please use the attached file baddoc6.txt
Open a new document in Mark Text
Paste in the text from baddoc6.txt
Put the cursor in the middle of the word 'Introduction' and press return.
Wordpress Templates
1 Intro
duction
The return has been inserted, but the two parts have been swapped round.
Wordpress Templates
duction
1 Intro
In fact the whole document is really messed up and exhibilts various odd behaviours. Putting the cursor in the middle of any paragraph and typing return causes the paragraphs to be swapped around and the cursor to jump to different places.
It seems to be connected with the line endings. I'm on Windows and the text file has single spacing using CR LF. When I posted originally the results were very confusing. My document got badly corrupted when I tried to paste in multiple paragraphs.
Thanks @tenbob, this is indeed a problem and also with soft line breaks (two spaces at the end of the line). At first I thought it was just a markdown parser failure because your given markdown file is not compatible with GFM and CommonMark (missing new line between text blocks) but it seems rather a problem with the HTML/markdown converter (importMarkdown.js and/or exportMarkdown.js) or enter controller (enterCtrl.js) because the new line is inserted at the wrong position.
Minimal example:
Copy and paste the following text into source code and switch into preview mode.
foo
ba<CURSOR>r
baz
Press return key and switch into source code mode - whereas <CURSOR> is the cursor position.
foo
r
ba
baz
You will notice the new line between ba and baz.
It seems to be connected with the line endings.
I don't think so, see above and I can reproduce it on Linux.
Most helpful comment
I have done some testing and got a better handle on this. Please use the attached file baddoc6.txt
Steps to reproduce
Open a new document in Mark Text
Paste in the text from baddoc6.txt
Put the cursor in the middle of the word 'Introduction' and press return.
What you expect
What you see
The return has been inserted, but the two parts have been swapped round.
In fact the whole document is really messed up and exhibilts various odd behaviours. Putting the cursor in the middle of any paragraph and typing return causes the paragraphs to be swapped around and the cursor to jump to different places.
It seems to be connected with the line endings. I'm on Windows and the text file has single spacing using CR LF. When I posted originally the results were very confusing. My document got badly corrupted when I tried to paste in multiple paragraphs.