'<' char will break the file on next open
See original GitHub issueDescription
Double bug in one here :
- When you open a file containing a
<
in a code block followed by a-Z char, All the text will be deleted after the<
occurrence till the end of line. Then the file is automatically saved and so you lose the line content forever.
Steps to reproduce
- create a file with the following
`if ( itemCount < s ) // some comment ` : followed by a space is good
`if ( itemCount <s ) // some comment ` : followed by a char from alphabet will truncate the line
- open this file using Marktext
- second line is truncated
- file is saved with truncated altered content
Expected behavior: [What you expected to happen]
- Marktext should correctly handle
<
- Marktext shouldn’t save the file directly after
open
command but only on user input (ctrl-s or autosave when typing)
Actual behavior: [What actually happened]
- File is altered
Versions
- Mark Text: 0.6.14
- OS: Windows 10
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Getting rid of \n when using .readlines() - Stack Overflow
I recently used this to read all the lines from a file: alist = open('maze.txt').read().split(). or you can use this for that little...
Read more >Encoding and line break characters - Visual Studio (Windows)
Learn about the characters that Visual Studio interprets as line breaks and how original encoding and line break characters are maintained.
Read more >Why are text file line breaks wrong, after the file is ... - WinSCP
After transferring or editing a file, it may happen that line breaks are wrong, what may manifest as: Line breaks are lost.
Read more >CRLF - MDN Web Docs Glossary: Definitions of Web-related ...
CR and LF are control characters or bytecode that can be used to mark a line break in a text file.
Read more >The Fastest Way to Split a Text File Using Python
A list can be split using Python list slicing. To do so, we first read the file using the readlines() method. Next, the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
😿 My fault, I forget escape the raw markdown when I parse it to HTML, It will be fixed.
@Ldoppea I reproduce it, parse5 treat
<s
inif (itemCount <s)
as<s>
element. So some error occur. I’ll open an issue in parse5. thank you!