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

Add urlFormatter option #48

Closed
wants to merge 1 commit into from

Conversation

jnordberg
Copy link

This allows to specify a url formatter function. Example:

var url = require('url');
var source = "[mylink](path/to/somewhere)";

marked.setOptions({
  urlFormatter: function(href) {
    return url.resolve('http://mydomain.com', href);
  }
});

console.log(marked(source)); // <p><a href="http://mydomain.com/path/to/somewhere">mylink</a></p>

@jnordberg
Copy link
Author

@chjj any thoughts on this?

@dherman
Copy link

dherman commented Jun 3, 2012

Consider this another vote for this feature — any interest in accepting the commit, @chjj?

Dave

@benatkin
Copy link

@chjj
Copy link
Member

chjj commented Jan 8, 2013

Going to redirect any discussion on this to #65. I'm not going to accept the PR because I'd rather have it be an option.

@chjj chjj closed this Jan 8, 2013
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.

4 participants