New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

prosemirror-find-replace

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-find-replace

Find and Replace plugin for ProseMirror

latest
Source
npmnpm
Version
0.9.0
Version published
Maintainers
1
Created
Source

prosemirror-find-replace

Find & Replace plugin for ProseMirror

Usage

Open your project in command prompt and run:

npm install prosemirror --save

npm install prosemirror-find-replace --save

In your ProseMirror initialization script:

import { ProseMirror } from "prosemirror"
import "prosemirror-find-replace"

let pm = new ProseMirror({
  place: document.querySelector("#target"),
  find: {}
})

Options

The following options can be passed in the find object when ProseMirror is initialized:

atuoSelectNext (Boolean, default: true): Moves user selection to the next find match after and find or replace

findClass (String, default:"find"): Class to apply to find matches

Commands

A simple, default set of commands is included, if you choose to use them:

import { ProseMirror, CommandSet } from "prosemirror/dist/edit"
import { findCommands } from "prosemirror-find-replace"

let pm = new ProseMirror({
  place: document.querySelector("#target"),
  find: {},
  commands: CommandSet.default.add(findCommands)
})

find (Meta + F) - Highlights all matches of find term, selects next one if autoSelectNext option is true

findNext (Alt + Meta + F) - Moves selection to next match of previous find

replace (Shift + Meta + F) - Finds next match and replaces it

replaceAll (Shift + Alt + Meta + F) - Finds and replaces all matches

clearFind (No shortcut) - Clears highlighted find results

Demo

To run a quick demo (based on ProseMirror demo) run the following from the prosemirror-find-replace directory in command prompt:

npm install

npm install prosemirror (npm > 3 will not install peerDependencies for you)

npm run demo

Then connect to http://localhost:8080 in your browser

FAQs

Package last updated on 03 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts