micromark
Version:
small commonmark compliant markdown parser with positional info and concrete tokens
11 lines (9 loc) • 299 B
JavaScript
export default movePoint
// Note! `move` only works inside lines! It’s not possible to move past other
// chunks (replacement characters, tabs, or line endings).
function movePoint(point, offset) {
point.column += offset
point.offset += offset
point._bufferIndex += offset
return point
}