Gatsby无法正确呈现句柄{:target =“ _ blank”}链接

时间:2018-11-20 23:07:58

标签: markdown gatsby

gatsby-transformer-remarkgastby-remark-external-links插件一起使用,无法按预期呈现[link](url){:target="_blank"}

gatsby-config.js

{
  resolve: 'gatsby-transformer-remark',
  options: {
    plugins: [
      {
        resolve: 'gatsby-remark-external-links',
        options: {
          target: '_blank',
          rel: 'noopener nofollow'
        }
      }
    ]
  }
},

使用: [Google](https://www.google.com/){:target="_blank"}

渲染器:

  • Google {:target =“ _ blank”}
  • <a href="url">Google</a>{:target="_blank"}

预期结果:<a href="https://www.google.com/" target="_blank" rel="noopener noreferrer"

可以通过gatsby-remark-external-links实现此行为吗?


更新

使用Can I create links with 'target=“_blank”' in Markdown? 中的[Google](https://google.com" target="_blank")向下滚动到“ Ghost Markdown注释”进行了成功的实验

已渲染:<a href="https://google.com" target="_blank" rel="nofollow">Google</a>

0 个答案:

没有答案