Skip to content

Update ejs.js - #168

Open
enowit wants to merge 1 commit into
tj:masterfrom
enowit:patch-1
Open

Update ejs.js#168
enowit wants to merge 1 commit into
tj:masterfrom
enowit:patch-1

Conversation

@enowit

@enowit enowit commented Apr 18, 2014

Copy link
Copy Markdown

identify and remove BOM header.

new function:
line = 52

/**

  • Render an EJS file at the given path (easton changed)
  • @PARAM {String} path
  • @PARAM {String} encoding
  • @api private
    */
    function readEJSFile(path, encoding) {
    var buffer = read(path);
    if (buffer[0] == 239 && buffer[1] == 187 && buffer[2] == 191) {
    buffer = buffer.slice(3);
    }
    return buffer.toString(encoding);
    }

Able to identify and remove BOM header.

new function:
line = 52

/**
 * Render an EJS file at the given `path` (easton changed)
 * @PARAM {String} path
 * @PARAM {String} encoding
 * @api private
*/
function readEJSFile(path, encoding) {
    var buffer = read(path);
    if (buffer[0] == 239 && buffer[1] == 187 && buffer[2] == 191) {
        buffer = buffer.slice(3);
    }
    return buffer.toString(encoding);
}
@matthewhadley

Copy link
Copy Markdown

Is this the same as this rejected PR in express-handlerbars? ericf/express-handlebars#77 (comment)

@enowit

enowit commented Sep 23, 2014

Copy link
Copy Markdown
Author

I submitted a update, in Apr. but nobody reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants