1
1
mirror of https://github.com/jxnblk/mdx-deck.git synced 2024-11-26 11:55:33 +03:00

Use normalize-newline for cross-platform support

This commit is contained in:
John Otander 2018-07-31 13:35:27 -06:00
parent fcd9232ed0
commit 388616b69c
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",