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

markdown.extractHeaders config option does not work #2071

Closed
1 task done
Otto-J opened this issue Dec 9, 2019 · 3 comments
Closed
1 task done

markdown.extractHeaders config option does not work #2071

Otto-J opened this issue Dec 9, 2019 · 3 comments

Comments

@Otto-J
Copy link

Otto-J commented Dec 9, 2019

  • I confirm that this is an issue rather than a question.

Bug report

Steps to reproduce

** English is not very good **

try change option config.js to be: markdown.extractHeaders:["h1", "h2", "h3"], on Post page, try to get this.$page.headers still return h2 and h3

and I changed the file: node_modules/@vuepress/core/lib/node/Page.js line117:

const headers = extractHeaders(
          this._strippedContent,
          ['h1','h2', 'h3'], // add 'h1' to here.
          markdown
        )

it worked.

so, I think markdown.extractHeaders option does not work.

What is expected?

on post page, get this.$page.headers includes h1 level

What is actually happening?

Other relevant information

"vuepress": "^1.2.0"

in Chinese:

制作主题时候,想通过设置makdown.extractHeaders, 来 this.$page.headers 获取到所有的heading 标签,感觉是硬解码写成固定的了,配置的选项也不生效。

@haoranpb
Copy link
Contributor

haoranpb commented Dec 9, 2019

Hi @Otto-J

Thanks for the report, markdown.extractHeaders option is currently not available in the 1.2.0 release.

This feature is implement by #1945 ,which is after the release of 1.2.0, please patiently wait for the next release. Thanks.

This issue is also related to #1931 , the document is updated faster than the release.


Simplified Chinese Verison:

markdown.extractHeaders 在下一个版本中才会生效。

@Otto-J
Copy link
Author

Otto-J commented Dec 9, 2019

@ludanxer Thanks.

@Otto-J Otto-J closed this as completed Dec 9, 2019
@bretterer
Copy link
Contributor

Thank you for this work as I tried to implement this in #1111 ... Is there any idea when the next release will happen which will include this work?

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

3 participants