James Draper
James Draper

Reputation: 5310

Inserting triple quotes inside of triple quotes in cson file

I'm trying to write a some python snippets for the Atom text editor and I would like to have triple quotes inside of a multi-line body but for some reason Atom does not like that. I've tried \\ to escape (as mentioned here near the page) but that does work either. I've left comments in the example below where I'd like to put triple quotes;

'.source.python':
  'Main Class':
    'prefix': 'mainclass'
    'body':"""
    class ${1:NewClass}(object):
        '$2' # I'd like triple quotes here. 
        def __init__(self, *args, **kwargs):
            '$3' # Here as well.
            ${4:pass}
    """

Is this even possible in cson?

Upvotes: 1

Views: 156

Answers (1)

James Draper
James Draper

Reputation: 5310

This works but it doesn't totally solve the problem. So feel free to add another more correct answer.

'.source.python':
  'Main Class':
    'prefix': 'mainclass'
    'body':'''
    class ${1:NewClass}(object):
        """$2"""
        def __init__(self, *args, **kwargs):
            """$3"""
            ${4:pass}
    '''

Upvotes: 1

Related Questions