1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-16 12:14:14 +02:00

change offset key serialization to allow dashes in keys, fixes #474

This commit is contained in:
Ian Storm Taylor
2017-10-26 14:06:22 -07:00
parent db6e29fbe3
commit e0978a31e9

View File

@@ -5,7 +5,7 @@
* @type {RegExp} * @type {RegExp}
*/ */
const PARSER = /^(\w+)(?:-(\d+))?$/ const PARSER = /^(\w+)(?::(\d+))?$/
/** /**
* Parse an offset key `string`. * Parse an offset key `string`.
@@ -34,7 +34,7 @@ function parse(string) {
*/ */
function stringify(object) { function stringify(object) {
return `${object.key}-${object.index}` return `${object.key}:${object.index}`
} }
/** /**