-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies, docs updated for webpack2, drop Node 0.12 suppor…
…t, update deps
- Loading branch information
Showing
9 changed files
with
129 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
.idea | ||
node_modules | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require("./markdown.md"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# heading 1 | ||
|
||
- buy pineapple | ||
|
||
## heading 2 | ||
|
||
_italic_ is the new __bold__ | ||
|
||
```javascript | ||
const i = 100; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
"use strict"; | ||
|
||
import test from "ava"; | ||
import webpack from "webpack"; | ||
import path from "path"; | ||
import fs from "fs"; | ||
import marked from "marked"; | ||
import markdownOptions from "./markdown-options"; | ||
|
||
test.cb(t => { | ||
webpack({ | ||
entry: path.resolve(__dirname, "./assets/markdown.md"), | ||
module: { | ||
rules: [{ | ||
test: /\.md$/, | ||
use: [ | ||
{ | ||
loader: "html-loader" | ||
}, | ||
{ | ||
loader: require.resolve("../index.js"), | ||
options: markdownOptions | ||
} | ||
] | ||
}] | ||
}, | ||
output: { | ||
libraryTarget: "commonjs2", | ||
path: __dirname + "/output", | ||
filename: "bundle.js" | ||
} | ||
}, function onCompilationFinished(err, stats) { | ||
if (err) { | ||
return t.end(err); | ||
} | ||
if (stats.hasErrors()) { | ||
return t.end(stats.compilation.errors[0]); | ||
} | ||
if (stats.hasWarnings()) { | ||
return t.end(stats.compilation.warnings[0]); | ||
} | ||
|
||
const bundle = require("./output/bundle"); | ||
t.is(bundle, '<h1 id=\"heading-1\">heading 1</h1>\n<ul>\n<li>buy pineapple</li>\n</ul>\n<h2 id=\"heading-2\">heading 2</h2>\n<p><em>italic</em> is the new <strong>bold</strong></p>\n<pre><code class=\"lang-javascript\"><span class=\"hljs-attribute\">const i</span> = 100;\n</code></pre>\n'); | ||
|
||
t.end(); | ||
}); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
renderer: require("./markdown-renderer"), | ||
highlight: function(code) { | ||
return require("highlight.js").highlightAuto(code).value; | ||
}, | ||
sanitize: false | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* globals escape */ | ||
var marked = require("marked"); | ||
var renderer = new marked.Renderer(); | ||
|
||
module.exports = renderer; |