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

设置MarkdownExtra的问题 #14

Open
maimengzi opened this issue Apr 8, 2018 · 1 comment
Open

设置MarkdownExtra的问题 #14

maimengzi opened this issue Apr 8, 2018 · 1 comment

Comments

@maimengzi
Copy link

maimengzi commented Apr 8, 2018

设置MarkdownExtra,H标题的转化会把id也显示出来,是不是自己要重新overides方法呢?

@djlxiaoshi
Copy link

djlxiaoshi commented Dec 17, 2019

目前我是这么做的,把所有的标题都转换成默认的配置

overides: {
      h1: function(node) {
        if (node.md) {
          return `\n# ${node.md}\n`
        }
      },
      h2: function(node) {
        if (node.md) {
          return `\n## ${node.md}\n`
        }
      },
      h3: function(node) {
        if (node.md) {
          return `\n### ${node.md}\n`
        }
      },
      h4: function(node) {
        if (node.md) {
          return `\n#### ${node.md}\n`
        }
      },
      h5: function(node) {
        if (node.md) {
          return `\n##### ${node.md}\n`
        }
      },
      h6: function(node) {
        if (node.md) {
          return `\n###### ${node.md}\n`
        }
      }
    }

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