我可以在specflow(或小黄瓜)中逃脱管道吗管道、小黄瓜、specflow

2023-09-08 00:29:53 作者:敬意

我有一个规范流步骤表,我希望将 |(竖线)字符作为内容的一部分.

I've got a specflow step table that I want to have the | (pipe) character as a part of the content.

例子:

Then the data should be
    | Field     | Value  |
    | SomeField | a|b|c  |

但这不起作用.如何转义管道字符?

But this doesn't work. How can I escape the pipe character?

推荐答案

呸.我不敢相信我没有早点找到这个.您可以使用反斜杠转义管道,但 specflow 语法高亮显示会被它弄糊涂.

Bah. I can't believe I didn't find this earlier. You CAN escape a pipe with the backslash, but the specflow syntax highlighter gets confused by it.

Then the data should be
    | Field     | Value    |
    | SomeField | a|b|c  |