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

Options to disable automatic header #ids #61

Closed
tasty-tasty opened this issue May 4, 2018 · 4 comments
Closed

Options to disable automatic header #ids #61

tasty-tasty opened this issue May 4, 2018 · 4 comments

Comments

@tasty-tasty
Copy link

tasty-tasty commented May 4, 2018

When we write in markdown file something like this:
### Heading

By default it will parse to:
<h3 id="Heading"><a href="#Heading" class="headerlink" title="Heading"></a>Heading</h3>

Marked parser has a feature to disable the automatic header ids in its advanced options, just set the "headerIds" to false and its ok.
screenshot_1

So do we have something like this ?

marked:
  headerIds: false

Or what i need to do to render normal view Headings, like <h3>Heading</h3>, without ids, classes or inner links

@tasty-tasty
Copy link
Author

Any ideas?

@tasty-tasty
Copy link
Author

Guys, need any help to solving the problem.

@tomap
Copy link
Contributor

tomap commented Aug 2, 2019

I found the issue:
We replace
https://github.com/markedjs/marked/blob/aff0aa414e8334f824526ffb669674cdead3454e/lib/marked.js#L967
with our own
https://github.com/hexojs/hexo-renderer-marked/blob/master/lib/renderer.js#L17
but did not reproduce the test:
if (this.options.headerIds) {
So the option does not apply in our case.
I'll do a PR to fix that

tomap added a commit to tomap/hexo-renderer-marked that referenced this issue Aug 2, 2019
(Enabled by default for backward compatibility)
hexojs#61
@tomap
Copy link
Contributor

tomap commented Aug 2, 2019

Done #106
Please, review & validate

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

2 participants