【问题标题】:Inserting triple quotes inside of triple quotes in cson file在 cson 文件中的三引号内插入三引号
【发布时间】:2018-01-12 19:50:39
【问题描述】:

我正在尝试为 Atom 文本编辑器编写一些 python sn-ps,我想在多行正文中添加三引号,但由于某种原因,Atom 不喜欢这样。我试过\\ 来逃避(如here near the page 所述),但这也确实有效。我在下面的示例中留下了 cmets,我想在其中添加三引号;

'.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}
    """

这在 cson 中是否可行?

【问题讨论】:

    标签: javascript coffeescript atom-editor cson


    【解决方案1】:

    这可行,但并不能完全解决问题。因此,请随时添加另一个更正确的答案。

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

    【讨论】:

    • 这不是“完全”解决问题吗?
    • 在极不可能的情况下,有人需要在正文元素中使用三个单引号和三个双引号。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-12
    • 2016-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-02
    相关资源
    最近更新 更多