yfs
October 17, 2025, 1:09pm
1
Hi Nick
Trying to use the following search extension with a specific browser. It gives me an error:
“Invalid YAML: bad indentation of a mapping entry (5:1…)”
What’s wrong?
#popclip
name: crossref-zen
description: Activate Crossref in Zen Browser
icon: iconify:academicons:crossref-square
javascript: popclip.openUrl(“https://search.crossref.org/?q=” + encodeURIComponent(popclip.input.text) + “&from_ui=yes”, { app: “app.zen-browser.zen” })
1 Like
nick
October 17, 2025, 3:23pm
2
It doesn’t like something on the 5th line. YAML can be sensitive to certain character in string content when inline like that.
You also have “smart quotes” but this might be due to copy/pasting.
(Please note when putting code on the forum you should use the code formatting option which is in the editor toolbar. I edited your post to add code formatting.)
The error can be solved by turning it into a block like this:
#popclip
name: crossref-zen
description: Activate Crossref in Zen Browser
icon: iconify:academicons:crossref-square
javascript: |
popclip.openUrl("https://search.crossref.org/?q=" + encodeURIComponent(popclip.input.text) + "&from_ui=yes", { app: "app.zen-browser.zen" })
Even better (how I would do it):
// #popclip
// name: crossref-zen
// description: Activate Crossref in Zen Browser
// icon: iconify:academicons:crossref-square
// language: javascript
const url = new URL("https://search.crossref.org/")
url.searchParams.set("q", popclip.input.text);
url.searchParams.set("from_ui", "yes");
popclip.openUrl(url, { app: "app.zen-browser.zen" })
1 Like
yfs
October 17, 2025, 3:43pm
3
wow - this is great. I I didn’t know your proper solution, which is much more elegant.
nick
October 17, 2025, 3:46pm
4
Great! Always pleased to have to opportunity to post good examples. Still figuring out the best practices myself, so it has evolved over time.