Apple Notes extension isn't working

Here’s an updated snippet to go with Build 4573. It has the advantage of preserving links in the selected text content. It also embeds URLs shared to notes as URL previews rather than plain links.

// #popclip
// name: NotesTest2
// popclip version: 4573
// captureHtml: true
// captureRtf: true
// language: javascript
const items = [];
if (popclip.input.isUrl) {
  items.push({ url: popclip.input.data.urls[0] });
} else if (popclip.input.content["public.rtf"]) {
  items.push(new RichString(popclip.input.rtf, { format: "rtf" }));
} else if (popclip.input.content["public.html"]) {
  // note this uses the sanitized html with formatting removed
  items.push(new RichString(popclip.input.html, { format: "html" }));
} else {
  items.push(popclip.input.text);
}
popclip.share("com.apple.Notes.SharingExtension", items);

(The above block is an extension snippet — select it then click “Install Extension” in PopClip.)