From 388616b69cb0c73dca20e169b7d8ea523758b576 Mon Sep 17 00:00:00 2001 From: John Otander Date: Tue, 31 Jul 2018 13:35:27 -0600 Subject: [PATCH] Use normalize-newline for cross-platform support --- lib/loader.js | 4 +++- package.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/loader.js b/lib/loader.js index 7597169..beb4512 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -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, '(')) diff --git a/package.json b/package.json index 34946f2..c07a75b 100644 --- a/package.json +++ b/package.json @@ -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",