Skip to content

Sample remarkable plugin does not match content beginning with a mention #155

Open
@jpribyl

Description

@jpribyl

if (!state.src || !state.pos) {

0 is falsey 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:

        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 () {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions