Line Ending Bugs with External Editor

I've been using markdown for my University notes for awhile now, and ive been using more and more math equations with KaTeX.

Ive come across an issue using VScode as my external editor (I use VScode for large/complex multi-line editing and large Regex search&replace). When I open a note that has the \rightarrow element in a math equation, every \r is replaced with a newline.

For example:

$V_f = V_s = I_f R_f \rightarrow \text{KVL}$

gets replaced with

$V_f = V_s = I_f R_f 
ightarrow \text{KVL}$

This seems to be a bug on the Joplin side since it occurs when I use Notepad++ as my external editor as well.

I know Unix-style line endings (\n) and DOS line ending (\r\n) are different, But neither are \r on its own, so this seems to me like a regex issue somewhere in the file watching service.

Interested for a Joplin developer's opinion on this issue, and would love to get it fixed!


Steps for Reproducing:

  1. Create a note with a formula containing a \rightarrow
    # Example note
    $$
        f(x) = x^2 + 2x + 3 \rightarrow \text{Standard Quadratic Equation}
    $$
    
  2. Open the file in External Editor
  3. Make any changes and save
  4. Open again Joplin
  5. Observe the \r has been replaced with a newline
  6. :frowning_face:

Joplin Version: v1.3.18
OS: Windows 10 - 19041
External Editor: VSCode(v1.51.1) & Notepad++ (v7.9)

Fixed in https://github.com/laurent22/joplin/commit/1dd6c7dde5372462d718b40a6472f7d0673a17a5

1 Like

How should I use these two files in the desktop applications?

Which 2 files?

This link (https://github.com/laurent22/joplin/commit/1dd6c7dde5372462d718b40a6472f7d0673a17a5) contains two files, how should I use them?

@Liangjin, this is just the source code, you'll need to wait till v1.5 is released, or you can use the pre-release.

@laurent Looks like that specific commit was added in v1.4.12.

1 Like