Open jpribyl opened 3 years ago
https://github.com/Rosey/markdown-draft-js/blob/0a8059cfd03f3678c5dd6c311a50acad16c28756/test/markdown-to-draft.spec.js#L372
0 is falsey in JS, so this will not match a mention at the start of an editor.
0
falsey
A better idea here would be to use something like:
if (!state.src || typeof state.pos !== 'number') {
A test case could then be added:
it('can handle editor beginning with block entity data', function () {
Alternatively, it could just be a second check in the existing test:
it('can handle block entity data', function () {
If desired, I can submit a PR with this change
https://github.com/Rosey/markdown-draft-js/blob/0a8059cfd03f3678c5dd6c311a50acad16c28756/test/markdown-to-draft.spec.js#L372
0
isfalsey
in JS, so this will not match a mention at the start of an editor.A better idea here would be to use something like:
A test case could then be added:
Alternatively, it could just be a second check in the existing test: