Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jpribyl opened this issue Jun 22, 2021 · 1 comment
Open

Comments

@jpribyl
Copy link

jpribyl commented Jun 22, 2021

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 () {
@jpribyl
Copy link
Author

jpribyl commented Jun 22, 2021

If desired, I can submit a PR with this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant