Skip to content

Question: how to check in sequence if there is a whitespace + symbol #26

@RokasVaitkevicius

Description

@RokasVaitkevicius

Hello, I don't want to capture sequence, when there are no whitespaces: bla+something+bla, I only want to capture, when there are whitespaces: bla +something+ bla. I am having trouble getting this to work.

Catching everything between + is straight forward: m.seq('+', this.plainTextEmphasis, '+').ast, but I wan to parse it only when ther is a space/empty line before and after +.

I've tried just adding space char in the sequence before +, but that doesn't seem to work:
m.seq(' ', '+', this.plainTextEmphasis, '+', ' ').ast

I've also tried replacing whitespace with ws, atWs etc., but that didn't help either.

Does anyone know, how to do it properly?

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