Siempre que represento una plantilla JADE, obtengo todo el HTML en una sola línea. Esto dificulta la lectura en modo de fuente de vista. ¿Cómo puedo decirle a JADE que cree HTML que esté correctamente sangrado?
Aquí está mi plantilla:
#application p#docs a(href='/docs/index.html') Documentation p#user-input input#msg(name='msg', size='50') input#submit(name='submit', type='submit', value='Send a Message') ul#messages
En las opciones de comstackción de Jade se ajustan pretty
a verdadero.
Lo que se puede hacer de varias maneras dependiendo de cómo los esté comstackndo.
-P
o --pretty
. app.locals.pretty = true;
(Express 2.x utilizó una syntax diferente: app.set('view options', { pretty: true });
consulte la guía de migración: https://github.com/visionmedia/express/wiki/Migrating-from-2 .x-a-3.x )
Entonces puedes hacer lo siguiente
#test. // <-- notice the dot Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s , when an unknown printer took a galley of type and scrambled
que producirá
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s , when an unknown printer took a galley of type and scrambled