haml-compiler.js 304 B

1234567891011121314
  1. var ensureRequire = require('../ensure-require.js')
  2. const throwError = require('../throw-error')
  3. module.exports = function (raw) {
  4. var html
  5. ensureRequire('hamljs', 'hamljs')
  6. var haml = require('hamljs')
  7. try {
  8. html = haml.render(raw)
  9. } catch (err) {
  10. throwError(err)
  11. }
  12. return html
  13. }