Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write pug array in multiple lines

I want to write my pug array in multiple lines like this:

- var data = [
  ["1", "1.1"], 
  "2"
]

but pug doesnt allow it. I have to write it inline like this atm:

- var data = [["1", "1.1"], "2"]

Any idea? Thanks for help.

like image 200
phng Avatar asked Jan 17 '17 00:01

phng


1 Answers

As suggested in https://github.com/pugjs/pug/issues/502#issuecomment-137893041

try this:

- 
  var data = [
    ["1", "1.1"], 
    "2"
  ]

Note that the - is on a separate line.

like image 182
Rahul Desai Avatar answered Oct 12 '22 16:10

Rahul Desai