Skip to content

Lexer error notified to report parse issue on github md parsing #635

@kaiyzen

Description

@kaiyzen

Learning marked, tried some of the examples in the README file, edited one to read the README.md contents from:

https://raw.githubusercontent.com/chjj/marked/master/README.md

I get this error/trace from marked on parse:

c:\dev\testNode>node test.js
c:\dev\testNode\node_modules\marked\lib\marked.js:1226
    throw e;
          ^
TypeError: undefined is not a function
Please report this to https://github.com/chjj/marked.
    at Lexer.lex (c:\dev\testNode\node_modules\marked\lib\marked.js:138:6)
    at Function.Lexer.lex (c:\dev\testNode\node_modules\marked\lib\marked.js:129
:16)
    at marked (c:\dev\testNode\node_modules\marked\lib\marked.js:1218:31)
    at Object.<anonymous> (c:\dev\testNode\test.js:17:16)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)

Here is test file i ran:

var fs = require('fs');
var marked = require('marked');

marked.setOptions({
  renderer: new marked.Renderer(),
  gfm: true,
  tables: true,
  breaks: false,
  pedantic: false,
  sanitize: true,
  smartLists: true,
  smartypants: false
});

//console.log(marked('I am using __markdown__.'));
var mdString = fs.readFileSync('test.md');
var markedUp = marked(mdString);

fs.writeFile('test.html',markedUp,function(err){
    if(err) {
        console.log('ERROR:');
        console.log(err);
        return;
    }
console.log('wrote file output');
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions