I can see this being the case for general use cases, however this 
addition is specifically tailored to Github Flavored Markdown, and as 
such following their conventions. Also note that it's using the heading 
text  not the id. I can see the scrollspy working like this, but if I'm 
missing something tell me please

On 03/27/2013 06:40 PM, Michal Srb wrote:
>
> In lib/marked.js:
>
> > @@ -820,9 +820,22 @@ Parser.prototype.tok = function() {
> >        return '<hr>\n';
> >      }
> >      case 'heading': {
> > +      var internal = '';
> > +      if (this.options.gfm) {
> > +        var link = this.token.text
> > +          .toLowerCase()
> > +          .replace(/\s/g, '-')
> > +          .replace(/[^a-z0-9-_\:\.]/g, '');
>
> Some (bootstrap's scrollspy for example) might want to select elements 
> like this: a[href=the-converted-id]
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/chjj/marked/pull/131/files#r3555907>.
>