How to insert two nodes at once?

// Replacing with a image node which uses a url 

let attrs = {
        title: node.text, // node.text is the URL
        href: node.text,
        target: '_blank',
      let linknode = view.state.config.schema.nodes.paragraph.create(,
      // This is not inserting anything. Requirement is to place a url below the newNode with "_blank" target.

How do I insert a link using a text with target _blank immediately after inserting below a node?

You can group multiple changes in a single transaction, if that’s what you’re asking. Just call the transaction methods (in this case replaceSelectionWith) on a single transaction and then dispatch that once.