You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@emergence-engineering/prosemirror-text-map

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emergence-engineering/prosemirror-text-map

![made by Emergence Engineering](https://emergence-engineering.com/ee-logo.svg)

0.1.4
latest
Source
npm
Version published
Weekly downloads
265
-0.75%
Maintainers
0
Weekly downloads
 
Created
Source

prosemirror-text-map

made by Emergence Engineering

Made by Emergence-Engineering

A library for manipulating ProseMirror documents in text format.

Convert a ProseMirror document to text, do the work, then map back positions in the text to the ProseMirror document.

This lib is mostly helpful for situations where you use other libraries whose working on texts only (like diffing, parsing, etc.) and you need to map back the results to the ProseMirror document (like adding marks based on text change).

use docToTextWithMapping to create a mapping object & textPosToDocPos to map text positions to document positions.

You can use an additional mapping option which could help you to serialise a node to a different format, this could be helpful for example if you want to add images to the diff algo, to detect image (source or alt) changes too.

FAQs

Package last updated on 11 Jul 2024

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