Question

How can I escape % characters in YAML?

Was it helpful?

Solution

Try %% it might work to escape.

OTHER TIPS

put the string it in double quotes: "%{var} some string"

If in doubt, try converting a string to yaml in IRB

C:\Documents and Settings\a.grimm>irb
irb(main):001:0> require "yaml"
=> true
irb(main):002:0> "I'm giving it 110%!".to_yaml
=> "--- I'm giving it 110%!\n"
irb(main):003:0> exit
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top