Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src.replace is not a function #700

Closed
raguay opened this issue Dec 24, 2015 · 4 comments
Closed

src.replace is not a function #700

raguay opened this issue Dec 24, 2015 · 4 comments

Comments

@raguay
Copy link

raguay commented Dec 24, 2015

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)

@joostlawerman
Copy link

It might be that you are not passing an string trough but an object or array.

@Feder1co5oave
Copy link
Contributor

^ Most likely this.
#682

@bennypowers
Copy link

bennypowers commented Dec 7, 2016

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.

@Feder1co5oave
Copy link
Contributor

Feder1co5oave commented Jan 25, 2018

Solved @joshbruce

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

No branches or pull requests

5 participants