Add support for custom inline #71

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant

pismute commented Aug 30, 2012

I need autolink for @ or # tags like twitter:

    marked('@marked #marked', { inline: function(down){
      return down(/(^|[ \t]+)@([a-zA-Z0-9]+)/,
        function(cap, src){
          return src.substring(cap[0].length);
        },
        function(cap, escape){
          return ['<a href="https://twitter.com/',
            cap[2], '">@', cap[2], '</a>'].join('');
        }
      ) || down(/(^|[ \t]+)#([a-zA-Z0-9]+)/,
        function(cap, src){
          return src.substring(cap[0].length);
        },
        function(cap, escape){
          return ['<a href="https://twitter.com/#!/search/%23',
            cap[2], '">#', cap[2], '</a>'].join('');
        }
      )
    }})

How about this?

pismute closed this Sep 13, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment