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.
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?