arena-js icon indicating copy to clipboard operation
arena-js copied to clipboard

Docs example for block creation references string, but seems to require obj

Open iblind opened this issue 3 years ago • 0 comments

Just a heads up for the readme example, noticed that attempts to create a block using arena.block().create("great-websites", "are.na/") yielded a

.../node_modules/are.na/index.js:128
        if (opts.content.match(/^https?:\/\//)) {
                         ^

TypeError: Cannot read property 'match' of undefined

error. This appears to be addressed by passing an object rather than a string as the argument:

const newBlock = {
  content: "are.na",
  title: "Your Title",
  description: "Your desc"
}


arena.block().create("great-websites", newBlock);

iblind avatar Apr 05 '21 18:04 iblind