mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-17 20:51:20 +02:00
change offset key serialization to allow dashes in keys, fixes #474
This commit is contained in:
@@ -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}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user