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

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

Open
RokasVaitkevicius opened this issue Sep 30, 2019 · 0 comments

Comments

@RokasVaitkevicius
Copy link

RokasVaitkevicius commented Sep 30, 2019

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?

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