How Do I Preserve Line Feeds When URL Encoding For UpNote?

I am trying to create a new note via the x-callback url scheme for UpNote.

The note is created successfully but the line endings are converted to spaces. I guess this is due to the URL encode.

How do I preserve the line endings in the note?

Upnote new note via x-callback.kmmacros (5.6 KB)

The macro creates a note like this:

CleanShot 2022-04-16 at 14.01.20@2x

Instead of this:

CleanShot 2022-04-16 at 14.01.42@2x

Do you have the impression that URL encoding removes line breaks ?

It seems, here, to preserve them:

Encoding and decoding does seem to preserve newlines.kmmacros (3.4 KB)

This works like it should but using the variable "someEncodedlines" in the x-callback url scheme removes the line breaks.

I think the problem is arising from the UpNote app.

1 Like

@Zirm -- What happens if you put in 2 line breaks for every one you want to appear in your note?

Same result. The multiple line breaks are converted into a single space.

@Zirm, to be clear -- was that using @ComplexPoint's "someEncodedLines" result, or your original macro?

Have you tried doing this manually? IE what happens if you simply type in




I don't really understand your original macro but, at first glance, it looks like you are double-encoding -- the "sample output" in your last-but-one step contains "%250A"s, ie a URL encoded "%" symbol followed by "0A", rather then the "%0A"s I'd expect to be fed into the URL (though I don't know why that would result in the behaviour you're seeing!).

Both gave the same result.
CleanShot 2022-04-16 at 19.44.23@2x

CleanShot 2022-04-16 at 19.48.38@2x

@Zirm, I think you're right -- Upnote simply doesn't accept line feeds (or carriage returns, or both together) in a callback URL. Other encoded characters do work -- although, since you can't use returns in search and replace, using eg "$$$$$" and replacing with line feeds later would be tricky.

You may need to go another route, like typing or pasting into a new note or saving out a text (or Markdown, if you've paid for Upnote) file and importing it.

Thanks a bunch. I have also contacted Upnote support.
I will try out a typing and pasting macro in the meantime.

@Zirm Oh my god, I want this so badly. Did you ever fix this?

No. Hasn't been fixed.

I ran into this issue with UpNote as well. I recently submitted this as a bug via their email, They quickly fixed it afterwards in version 6.9.0. You can read more about it here:

1 Like