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:
commit
a784d98c75
@ -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, '('))
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user