I am getting this error when I try to use this library:
TypeError: src.replace is not a function
Please report this to https://github.com/chjj/marked.
at Lexer.lex (/Volumes/External/projects/BuildCMS/node_modules/marked/lib/marked.js:138:6)
at Function.Lexer.lex (/Volumes/External/projects/BuildCMS/node_modules/marked/lib/marked.js:129:16)
at marked (/Volumes/External/projects/BuildCMS/node_modules/marked/lib/marked.js:1218:31)
at figurePage (/Volumes/External/projects/BuildCMS/nodePress.js:227:12)
at processPage (/Volumes/External/projects/BuildCMS/nodePress.js:160:23)
at page (/Volumes/External/projects/BuildCMS/nodePress.js:135:9)
at /Volumes/External/projects/BuildCMS/nodePress.js:110:16
at Layer.handle as handle_request
at next (/Volumes/External/projects/BuildCMS/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/Volumes/External/projects/BuildCMS/node_modules/express/lib/router/route.js:112:3)
It might be that you are not passing an string trough but an object or array.
^ Most likely this.
I have this same error. I'm using firebase with polymerfire. If i bind a firebase document to data then bind <marked-element id="el" markdown="[[data]]"> I'll get several of these errors.
I got around that by setting up this observer:
observers: [
'_dataChanged(data, data.*)'
],
_dataChanged: function(data) {
if (typeof data === "string") {
this.$.el.markdown = data;
}
}
That works fine but it would be nice if marked.js handled this check for me so i could just bind onto my data and go.
Solved @joshbruce
Most helpful comment
It might be that you are not passing an string trough but an object or array.