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

[Bug report] markdown-it plugin cant load by using config.markdown.plugins config. #2175

Closed
1 task done
yibhou opened this issue Feb 9, 2020 · 8 comments
Closed
1 task done

Comments

@yibhou
Copy link

yibhou commented Feb 9, 2020

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

Bug report

Steps to reproduce

What is expected?

Using config below can correctly load markdown-it plugin like the doc.

module.exports = {
  markdown: {
    plugins: [
      'markdown-it-sub'
      // or
      ['markdown-it-xxx', { /* options */ }]
    ]
  }
}

Actually it cant load any markdown-it plugins. But loading correctly in using markdown.extendMarkdown like:

markdown: {
    extendMarkdown: md => {
      md.use(require('markdown-it-sub'))
    }
  }

What is actually happening?

Actually cant load any markdown-it plugins

Other relevant information

  • Output of npx vuepress info in my VuePress project:
Environment Info:

  System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
  Binaries:
    Node: 10.15.2 - ~/.nvm/versions/node/v10.15.2/bin/node
    Yarn: 1.22.0 - ~/Documents/Projects/oh-my-test/src/blog/node_modules/.bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.15.2/bin/npm
  Browsers:
    Chrome: 80.0.3987.87
    Firefox: 71.0
    Safari: 12.1.2
  npmPackages:
    @vuepress/core:  1.3.0 
    @vuepress/theme-default:  1.3.0 
    vuepress: ^1.3.0 => 1.3.0 
  npmGlobalPackages:
    vuepress: Not Found
@yibhou yibhou changed the title markdown-it plugin cant load by using config.markdown.plugins config. [Bug report] markdown-it plugin cant load by using config.markdown.plugins config. Feb 9, 2020
@kefranabg
Copy link
Collaborator

Please provide a reproduction repository so we can help you.

@kefranabg kefranabg added the needs reproduction Waiting for a reproduction link (codepen, code sandbox, GH repos) label Feb 9, 2020
@yibhou
Copy link
Author

yibhou commented Feb 10, 2020

Hi, @kefranabg. This is a reproduction repository.

@kefranabg
Copy link
Collaborator

extendMarkdown should be placed at the root of the config object. Not under markdown.

@yibhou
Copy link
Author

yibhou commented Feb 11, 2020

See the document, that is under markdown. And its actually correct.

@kefranabg kefranabg reopened this Feb 11, 2020
@kefranabg
Copy link
Collaborator

markdown.plugins looks deprecated. Can't find any reference to it in the VuePress code. We'll investigate. Thanks for the report !

@billyyyyy3320 billyyyyy3320 removed the needs reproduction Waiting for a reproduction link (codepen, code sandbox, GH repos) label Aug 29, 2020
@meteorlxy
Copy link
Member

meteorlxy commented Sep 1, 2020

markdown.plugins looks deprecated. Can't find any reference to it in the VuePress code. We'll investigate. Thanks for the report !

@kefranabg It's not deprecated. All the logic is placed in the @vuepress/markdown package.

@meteorlxy meteorlxy added the type: bug Something isn't working label Sep 1, 2020
@meteorlxy
Copy link
Member

meteorlxy commented Sep 1, 2020

It was a bug of module resolver. And have already been resolved in #2289 .

Didn't notice this issue

@meteorlxy meteorlxy removed the type: bug Something isn't working label Sep 1, 2020
@meteorlxy
Copy link
Member

Ref #2286

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