bitovi / documentjs

The sophisticated documentation engine
https://documentjs.com/
MIT License
598 stars 381 forks source link

Does not handle the Unicode byte order mark (BOM) #215

Open rjgotten opened 9 years ago

rjgotten commented 9 years ago

DocumentJS fails to take into account the presence of a Unicode byte order mark (BOM) in a documentjs.json configuration file, resulting in an immediate crash and a stack trace resembling the following:

C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:126
                    throw e;
                          ^
SyntaxError: Unexpected token 
    at Object.parse (native)
    at readFile.then.documentConfig.sites.project.sites.docs.glob.ignore (C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\lib\configured\generate_project.js:87:25)
    at _fulfilled (C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:787:54)
    at self.promiseDispatch.done (C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:816:30)
    at Promise.promise.promiseDispatch (C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:749:13)
    at C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:557:44
    at flush (C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:108:17)
    at process._tickCallback (node.js:419:13)