ProseMirror/CodeMirror offsets
See original GitHub issueHow does the offset
on a match relate to its position in a document?
Is it possible to get the character index of the match within an entire document?
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Embedded code editor - ProseMirror
When adding steps to a transaction for content changes, the offset is adjusted for the changes in length caused by the change, so...
Read more >CRDTs & Positions in CodeMirror 6
Your blog post describes perfectly the advantages of using a CRDT for position mapping. As I described in the ProseMirror forum, the current ......
Read more >ProseMirror Plugin for CodeBlock Decorations · GitHub
Global set of CodeMirror languages to dynamically import. */. const codeMirrorImports = new Set(); ... Calculate token offsets and apply decorations.
Read more >How to use the codemirror.Pass function in codemirror - Snyk
To help you get started, we've selected a few codemirror examples, based on popular ways it is used in public projects. ; ProseMirror...
Read more >Comparison with Other Rich Text Editors - Quill.js
ProseMirror is relatively new but has already captured signficant attention, being built by the same author of CodeMirror.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
beautiful. Yeah, you can use
nlp.tokenize()
to fast-parse and cache the unchanged sentences. That’s what I would do. cheers@spencermountain Thanks for pinging me to circle back here! 😄
I was able to use
doc.match()
to find parts of speech and decorate them with ProseMirror by getting offsets from the.json()
call. It was actually pretty smooth sailing once I figured out how the offsets and positions were calculated.I’m still working through how to optimize my system because I want it to run on each keystroke and for the moment it’s not scaling well on larger text samples.