@fullstackio/cqmd
Advanced tools
Comparing version 5.3.2 to 5.4.0
{ | ||
"name": "@fullstackio/cqmd", | ||
"version": "5.3.2", | ||
"version": "5.4.0", | ||
"description": "markdown pre-processor for cq", | ||
@@ -21,3 +21,3 @@ "main": "src/index.js", | ||
"@fullstackio/cq": "^5.3.0", | ||
"@fullstackio/remark-cq": "^5.3.2", | ||
"@fullstackio/remark-cq": "^5.4.0", | ||
"rehype-stringify": "^5.0.0", | ||
@@ -39,3 +39,3 @@ "remark": "^5.0.1", | ||
}, | ||
"gitHead": "32a622bf69a18b96b40037b602ba896df4eb90eb", | ||
"gitHead": "21eae0557285d5348eed341af3b15ae50f042c75", | ||
"optionalDependencies": { | ||
@@ -42,0 +42,0 @@ "chokidar": "^2.0.4" |
@@ -1,13 +0,10 @@ | ||
import 'babel-polyfill' | ||
import chai from 'chai'; | ||
const chai = require("chai"); | ||
const assert = chai.assert; | ||
import cqmd from '../src/index'; | ||
import fs from 'fs'; | ||
const cqmd = require("../src/index"); | ||
const fs = require("fs"); | ||
describe('cqmd core', () => { | ||
describe("cqmd core", () => { | ||
it("should convert to gfm", async () => { | ||
let input = `# a document | ||
it('should convert to gfm', async () => { | ||
let input = ` | ||
# a document | ||
Here's some code | ||
@@ -23,7 +20,5 @@ | ||
That's all | ||
` | ||
That's all`; | ||
let expected = ` | ||
# a document | ||
let expected = `# a document | ||
@@ -46,8 +41,42 @@ Here's some code | ||
That's all | ||
` | ||
let actual = await cqmd(input, {path: __dirname}); | ||
`; | ||
let actual = await cqmd(input, { root: __dirname }); | ||
assert.equal(actual, expected); | ||
}); | ||
it("should load files it can't parse by line numbers", async () => { | ||
let input = `Here's some code | ||
}) | ||
{lang=javascript,crop-start-line=1,crop-end-line=5} | ||
<<[](data/VueComponent.vue)`; | ||
let expected = `Here's some code | ||
\`\`\`javascript | ||
<template> | ||
<div> | ||
<ChildComponent :numbers="numbers" /> | ||
</div> | ||
</template> | ||
\`\`\` | ||
`; | ||
let actual = await cqmd(input, { root: __dirname }); | ||
assert.equal(actual, expected); | ||
}); | ||
it("should load a while file if you don't specify otherwise", async () => { | ||
let input = `Here's some code | ||
{lang=frobner} | ||
<<[](data/textfile.txt)`; | ||
let expected = `Here's some code | ||
\`\`\`frobner | ||
This is a short textfile | ||
*_* | ||
\`\`\` | ||
`; | ||
let actual = await cqmd(input, { root: __dirname }); | ||
assert.equal(actual, expected); | ||
}); | ||
}); |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
113870
18
224