YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key

how can i fix this ?

#popclip
name: UpNote
icon: U
capture html: true
javascript: |
  const article = {
    html: popclip.input.html,
    title: popclip.context.browserTitle,
    url: popclip.context.browserUrl
  }
  const encoded = encodeURIComponent(JSON.stringify(article))
  popclip.openUrl('upnote://x-callback-url/clipper?article=' + encoded)
1 Like

I’m not sure what the original problem was, but I cleaned up the markup (by adding ``` before and after the code in your post) and indented the lines, and it’s working now.

So it’s likely the orignal YAML was not valid, maybe due to indenting (it’s usually indenting).

By the way,. you might consider writng it in tne inverted syntax (which is easier to work with for JavaScript extensions) like this:

// #popclip
// name: UpNote
// icon: U
// capture html: true
// language: javascript
const article = {
  html: popclip.input.html,
  title: popclip.context.browserTitle,
  url: popclip.context.browserUrl
}
const encoded = encodeURIComponent(JSON.stringify(article))
popclip.openUrl('upnote://x-callback-url/clipper?article=' + encoded)
1 Like

nick, I fucking love your app and your work, but i gotta say, i don’t understand a thing about coding and how it works hahah

i just tried with your code and get that result

image

okay I got it, had to add ) at the end. you had forgotten it. man code makes me crazy, so simple yet i feel so stupid when i try to do something with it hahaha

Hah, oops. I’ve added it back in to the post.

Believe in yourself — you figured it out! Sorry about the extra coding test :wink:

1 Like

Dont apologize hahaha

Thanks a lot

Unrelated but since you work beautifully (at least I love your work that’s all I can tell you) , if you happen to have resources on coding basics and text stuff like this yml sh*t , don’t hesitate to share, I’ll try to get into it someday :slight_smile:

Programming is such a huge topic nowadays, it can be really daunting and everyone has an opinion about everything.

I struggle to know where to tell people to start because I started learning in the 1980s when I was 8 from this book (I had a Commodore 64).

It also depends on your learning style. There are “how to code” videos on every topic on youtube for example and courses on Udemy and elsewhere.

When I get lost I always start by finding the manual for whatever it is and just sit an read it. You could always start with PopClip Extensions Developer Reference.

1 Like

4 posts were split to a new topic: How to update PopClip?