Snippet Not Working?


#1

‘.source.html’:
‘HTML Quick Startup’:
‘prefix’: ‘qhtml’
‘body’: '\n

\n \n \n title\n \n \n \n \n \n \n \n'

#2

Never mind. Forum messed up all my text. Disregard this post as I can’t delete or edit it


#3

You need to wrap code in backticks, which is easily done by selecting your text and hitting the </> button above the editor.


#6
'.source.html':
'HTML Quick Startup':
'prefix': 'qhtml'
'body': '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<!-- page content -->
</body>
</html>'

#7

If your code is flat like that, that’s a problem. CSON is indentation-reliant. But assuming you just forgot to add the indentation back in, your problem is that you need different quoting for multi-line CSON values. This will work:

'.source.html':
  'HTML Quick Startup':
    prefix: 'qhtml'
    body: """
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>title</title>
  <link rel="stylesheet" href="style.css">
  <script src="script.js"></script>
</head>
<body>
  <!-- page content -->
</body>
</html>
"""