Line breaks are lost when copying text from obsidian to another application

What I’m trying to do

I have a note that contains commonly used chunks of text that I copy into another program to save time on repetitive typing.

This works fine for most programs, but line breaks are lost when I try to copy text from obsidian into one particular, very old, program.

I’m guessing it’s some kind of text encoding issue, but I’m not sure. Does anyone know a way that I can format the text in obsidian that might force the old timey program to recognize line breaks?

Things I have tried

  1. Copying obsidian text into notepad. Works fine.
  2. Formatting text in the other application, and copying into obsidian. Results in double line breaks in obsidian.
  3. Copying that same text back from obsidian to the other program. All line breaks disappear.
  4. Copying the text from obsidian, into notepad, and then into the other program. Works fine
  5. Formatting obsidian text as a code block. No change
  6. Formatting obsidian text with double spaces at end of lines (to get single spaces in previewer). No change
  7. Formatting obsidian text with \ at the end of each line. No change
  8. Formatting obsidian text with whitespace lines in between. No change.

Another thing to try is paste without formatting. Often ctrl-shift-V as a shortcut I think. It might change the result.

However, you seem to be using a note for something that might be better to use a “snippet manager” for.

You can use these apps to trigger common phrases with keywords or hotkeys, and include other form-like customizations or date auto-formatting, etc.

Something to consider.

I’m not sure there’s any (currently existing) thing you can do in Obsidian to avoid this. It sounds like a problem with how line endings are encoded. Notepad had a similar issue when opening files up until a few years ago.

Perhaps there is some app you could share to that will convert and put the result in your clipboard (if you were on Mac it might be doable with Shortcuts).

Would using the plugin …

… placing <p> at the end of every line help?
(by replacing $ with <p>)