-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
Consider:
ed = exa.Editor("""
Some text with appropriate {
braces like some JSON
}""").write('mynewfile.json')Currently fails with a KeyError because the call to format() expects a dict with the keys being the contents in the brackets. A work-around is to do something simple like:
ed = exa.Editor("""
Some text with appropriate {
braces like some JSON
}""".replace('{', '{{').replace('}', '}}').write('mynewfile.json')This will assume there is no format kwargs to be passed and render as plain text.
Ideas: perhaps a "raw" keyword argument to Editor.write to supersede calling format()
It is also possible that one wants to mix and match raw curly braces with formatting curly braces, in which case the "raw" curly braces would need to be escaped somehow.