Double Bracket Search

I created an action to try and mimic the double bracket searching found in apps like nvALT and Bear. The search order is as follows:

  1. If a selection is made, search for that
  2. If no selection is made but one double bracket exists, search for that
  3. If multiple double brackets exist, prompt for which one to search
  4. Else, prompt for a search term

LINK: Double Bracket Search

Disclaimer: I started learning JavaScript last year when Drafts 5 came out so I could create actions. I’m sure the code is uglier than it could be BUT it should run just fine. :grin: