creationix / haml-js

Haml ported to server-side Javascript. This is a traditional server-side templating language. Tested with node-js
MIT License
900 stars 109 forks source link

%script doesn't close properly #7

Closed aeosynth closed 14 years ago

aeosynth commented 14 years ago

haml-js treats script tags as self closing, but <script /> does not work; script tags need to be closed with </script>.

I wrote a simple test app, which displays a link at '/', but nowhere else.

app.js var haml = require('./lib/haml'); var file = require('file'); var http = require('http');

http.createServer(function (req, res) {
  file.read('app.haml').addCallback(function (source) {
    var body = haml.render(source, {
        locals: {
          url: req.url
        }
    });
    res.sendHeader(200, {'Content-Type': 'text/html'});
    res.sendBody(body);
    res.finish();
  });
}).listen(8000);

app.haml %html %head :if url !='/' %script %body %a{ href: 'link' } link

$ node -v; git branch -v

0.1.25

edit: I tried this on Chrome and it works fine, but Opera/Firefox don't display.

creationix commented 14 years ago

Fixed, thanks for finding the regression.