question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'<' char will break the file on next open

See original GitHub issue

Description

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

  1. 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
  1. open this file using Marktext
  2. second line is truncated
  3. 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:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Jocscommented, Mar 20, 2018

😿 My fault, I forget escape the raw markdown when I parse it to HTML, It will be fixed.

1reaction
Jocscommented, Mar 20, 2018

@Ldoppea I reproduce it, parse5 treat <s in if (itemCount <s) as <s> element. So some error occur. I’ll open an issue in parse5. thank you!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found