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

Remove id attributes from heading elements #13

Closed
dink opened this issue May 19, 2015 · 5 comments
Closed

Remove id attributes from heading elements #13

dink opened this issue May 19, 2015 · 5 comments

Comments

@dink
Copy link

dink commented May 19, 2015

Is there a way to remove id attributes from heading elements?

## Awesome Title Here
produces:
<h2 id="awesome-title-here">Awesome Title Here</h2>

I'd much rather prefer clean markup such as:
<h2>Awesome Title Here</h2>

@butterybread
Copy link

+1

@shri3k
Copy link

shri3k commented Jun 12, 2015

This is not really this plugin's issue rather the package that this plugin depends on called marked which saw the change in this PR. Primarily with this commit. If anyone knows other markdown package then swapping it out shouldn't be a big problem.

@shri3k
Copy link

shri3k commented Jun 13, 2015

Oh..looks like there already is a plugin that uses a bit different flavor of markdown.

@dink
Copy link
Author

dink commented Jul 4, 2015

@sinkingshriek

Thanks, metalsmith-markdownit does it for me. Much appreciated.

@dink dink closed this as completed Jul 4, 2015
@ilyaigpetrov
Copy link
Contributor

// ...
marked = require('marked');
const renderer = new marked.Renderer();
renderer.heading = (text, level) => `<h${level}>${text}</h${level}>`;
// ...
  .use(markdown({
    renderer,
  }))
// ...

Thanks to markedjs/marked#326 (comment)

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

4 participants