1
1
mirror of https://github.com/jxnblk/mdx-deck.git synced 2024-11-29 13:58:02 +03:00

Merge pull request #23 from johno/normalize-newlines

Use normalize-newline for cross-platform support
This commit is contained in:
Brent Jackson 2018-07-31 18:02:28 -04:00 committed by GitHub
commit a784d98c75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,7 @@
const mdx = require('@mdx-js/mdx')
const matter = require('gray-matter')
const stringifyObject = require('stringify-object')
const normalizeNewline = require('normalize-newline')
const EXREG = /export\sdefault\s\(/g
const MODREG = /^(import|export)\s/
@ -12,7 +13,8 @@ module.exports = async function (src) {
const { data, content } = matter(src)
const inlineModules = []
const slides = content.split(SLIDEREG)
const slides = normalizeNewline(content)
.split(SLIDEREG)
.map(str => mdx.sync(str))
.map(str => str.trim())
.map(str => str.replace(EXREG, '('))

View File

@ -25,6 +25,7 @@
"gray-matter": "^4.0.1",
"lodash.debounce": "^4.0.8",
"meow": "^5.0.0",
"normalize-newline": "^3.0.0",
"ok-cli": "^3.0.4",
"pkg-conf": "^2.1.0",
"prop-types": "^15.6.2",