Search code examples
fitnesse

Escaping Curly Brace in FitNesse Variable Declaraion


I want to store the following strings in FitNesse variables:

!*< comment
{{{

and

}}}
*!

Unfortunately, the fact that they contain curly braces "{}" is problematic for variable declaration in FitNesse, since I would have to declare them like this:

!define IGNORE_START {!*< comment
{{{}

!define IGNORE_END {}}}
*!}

The results of which are obviously not what I'm hoping for. Normally, I would expect to be able to escape the curly braces that I want to be included in the variable contents. However, searching Google and StackOverflow, I've not found the proper method for doing this. Some trial-and-error involving backslashes has also not led me to the solution.

If this is possible, can somebody please tell me how? If it's not possible, I'd also like to know so I can just accept it and move on.


Solution

  • Put escape sequences in between !- -! e.g.

    !define IGNORE_START {
    !-!*< comment-!
    !-{{{-! 
    }
    
    !define IGNORE_END {
    !-}}}-!
    !-*!-!
    }
    
    ${IGNORE_START}
    ${IGNORE_END}