Headings Stripped from Notes in URL Scheme

Hi all!

I am creating (and appending to) notes via URL scheme, and have found that the first line (a URL-encoded markdown heading) is always stripped. Maybe it has something to do with the first character being #?

Example URL:

agenda://x-callback-url/create-note?project-title=Journal&title=Test&text=%23%20Life%20on%20the%20road%0A%0A%23%23%23%20Chapter%201%0AI%20need%20a%20better%20car.

In the note created, the first line (%23%20Life%20on%20the%20road%0A%0A% or, unencoded # Life on the road) is not present.

Is this a defect? Is there a workaround?

Thanks!

ScottyJ

1 Like

I think you may be encountering the markdown shortcuts. A hash at the start of a line, followed by a space, and then text, becomes a heading. A hash followed by text inside a line becomes a tag.

One thing you can do to preserve the text is to use Fixed Width or Preformatted format. Choose one of those, and then paste.

Kind regards,
Drew

Reading that, it looks like the markdown shortcuts aren’t doing their job: the text is being stripped, not turned into a heading, which was the expected behaviour. I can replicate that on Mac and iOS.

1 Like

And this reminds me I need to play with my shortcuts and the beta to check the behaviour hasn’t changed.

1 Like

I don’t think this is a new behaviour - I’m sure I came across it before playing with shortcuts and promptly forgot among all the other inconveniences of writing workflows.

I can replicate from Shortcuts with ‘# alpha’, not with ‘## alpha’ on the first line, so it’s only top level heading being eaten.

1 Like

Thanks for replicating this, @careilly!

@drewmccormack Yes, you are describing the expected behaviour, but that’s now what’s occurring. Interesting that using a second level heading (i.e. two hashes) works but a first level heading (i.e. one hash) doesn’t.

Cheers,

ScottyJ

Odd. I’ll add it to my list to check. I’m wondering if our importer normally turns that into a title, and in the shortcut, there is already a title, so the line is lost. Will check.

2 Likes

I’ve fixed this internally. It will be out in 6.0.1, which should follow soon after the major release for reminders.

2 Likes

Oh wow, amazing! Thanks for looking in to this and for the fix!

ScottyJ

1 Like

I noted the fix is in the latest TF. Thanks again!

ScottyJ

2 Likes