问题
I get Warning: missing space before text for line 20 of jade file
for this code:
Any ideas?
doctype html
html(ng-app="fooApp")
head
title Foo
script(language='javascript', src='bower_components/angular/angular.js', type='text/javascript')
script(language='javascript', src='bower_components/requirejs/require.js', type='text/javascript', data-main='js/Main.js')
script(language='javascript', src='http://cdn.peerjs.com/0.3/peer.js', type='text/javascript')
script(language='javascript', src='bower_components/platform/platform.js', type='text/javascript')
//link(rel="import", href="elements/elements.html" )
link(rel="import", href="bower_components/polymer/polymer.html" )
link(rel="import", href="bower_components/core-component-page/core-component-page.html" )
link(rel='import', href='core-scaffold.html')
link(rel='import', href='../core-header-panel/core-header-panel.html')
link(rel='import', href='../core-menu/core-menu.html')
link(rel='import', href='../core-item/core-item.html')
style
html, body { <-- line 20
height: 100%;
margin: 0;
}
回答1:
Try changing style
to style.
.
My guess is that Jade tries to parse your CSS rule, and does not understand it, as it is something written for the browser and not for the template engine.
Adding a dot .
will tell Jade to render the following block of text "as is", and to not try to parse it.
You can read more about it on Jade reference. Hope that helps.
来源:https://stackoverflow.com/questions/25124621/warning-missing-space-before-text-for-line-20-of-jade-file