Git Product home page Git Product logo

broccoli-html2js's Introduction

broccoli-html2js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

broccoli-html2js's Issues

parse error when using js-string-escape lib

//var htmlJsStr = require('js-string-escape');
var htmlJsStr = function (string) {
  return ('' + string).replace(/["'\\\n\r\u2028\u2029]/g, function (character) {
    // Escape all characters not included in SingleStringCharacters and
    // DoubleStringCharacters on
    // http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4
    switch (character) {
      case '"':
      case "'":
      case '\\':
        return '\\' + character
      // Four possible LineTerminator characters need to be escaped:
      case '\n':
        return '\\n'
      case '\r':
        return '\\r'
      case '\u2028':
        return '\\u2028'
      case '\u2029':
        return '\\u2029'
    }
  })
}

var templates_js = html2js(templateDir, {
  inputFiles: ['*.html',],
  outputFile: '/templates.js',      // or templates.coffee
  replaceContent: htmlJsStr
});

error output on html input

Error: Parse Error: <img ng-src=\"{{chat.face}}\" style=\"width: 64px; height: 64px\">\n    <p>\n      {{chat.lastText}}\n    </p>\n  </ion-content>\n</ion-view>\n [string exception]
    at /home/paul/myApp/node_modules/broccoli/lib/builder.js:35:15
    at $$$internal$$tryCatch (/home/paul/myApp/node_modules/broccoli/node_modules/rsvp/dist/rsvp.js:490:16)
    at $$$internal$$invokeCallback (/home/paul/myApp/node_modules/broccoli/node_modules/rsvp/dist/rsvp.js:502:17)
    at $$$internal$$publish (/home/paul/myApp/node_modules/broccoli/node_modules/rsvp/dist/rsvp.js:473:11)
    at $$$internal$$publishRejection (/home/paul/myApp/node_modules/broccoli/node_modules/rsvp/dist/rsvp.js:416:7)
    at Object.$$rsvp$asap$$flush [as _onImmediate] (/home/paul/myApp/node_modules/broccoli/node_modules/rsvp/dist/rsvp.js:1581:9)
    at processImmediate [as _immediateCallback] (timers.js:330:15)

I'm not really sure what is causing this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.