Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@abovedave
Copy link
Contributor

@abovedave abovedave commented Apr 16, 2018

See ticket #379

  • Removes the marked package
  • Provider rename: "type": "markdown" becomes "type": "text"
  • Default extension to txt

This is a breaking change for anyone that uses a datasource markdown , the object contentHtml has been removed, but contentText remains untouched so you are free to do your own parsing without needless overhead.

Migration example:

Before

{
  "datasource": {
    "key": "news",
    "source": {
      "type": "markdown",
      "path": "./content/news"
    },
    "paginate": true,
    "count": 12,
    "sort": {
      "attributes.date": 0
    }
  }
}
${text.results.map(i => `
  <h2>${i.attributes.title}</h2>
  ${i.attributes.contentHtml}
`).join('')}

After

{
  "datasource": {
    "key": "news",
    "source": {
      "type": "text",
      "path": "./content/news",
      "extension": "md"
    },
    "paginate": true,
    "count": 12,
    "sort": {
      "attributes.date": 0
    }
  }
}
${text.results.map(i => `
  <h2>${i.attributes.title}</h2>
  ${markdown(i.attributes.contentText)}
`).join('')}
const marked = require('marked')

module.exports.markdown = chunk => {
  if (!chunk) return
  return marked(chunk)
}

N.B. npm i marked

@abovedave abovedave added this to the 7.0.0 milestone Aug 30, 2018
@abovedave abovedave closed this Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants