aboutsummaryrefslogtreecommitdiff
path: root/__tests__
diff options
context:
space:
mode:
authorache <ache@ache.one>2020-05-06 08:06:57 +0200
committerache <ache@ache.one>2020-05-06 08:06:57 +0200
commit113aeb141672369b0e2b2bed6b9dabe52fe4b2bc (patch)
treea6845d3b4db9829eaebb21bd57fc276d39d0809f /__tests__
parentForbid empty atx header (diff)
Update package then source code
Diffstat (limited to '__tests__')
-rw-r--r--__tests__/index.js28
1 files changed, 15 insertions, 13 deletions
diff --git a/__tests__/index.js b/__tests__/index.js
index d67170f..bce565b 100644
--- a/__tests__/index.js
+++ b/__tests__/index.js
@@ -1,15 +1,16 @@
'use strict';
-import {join} from 'path';
-import {readFileSync as file} from 'fs';
-import test from 'ava';
-import raw from 'rehype-raw';
-import reParse from 'remark-parse';
-import stringify from 'rehype-stringify';
-import remark2rehype from 'remark-rehype';
-import unified from 'unified';
-import parse5 from 'parse5';
-import plugin from '..';
+const {join} = require('path');
+const file = require('fs').readFileSync;
+const test = require('ava');
+const raw = require('rehype-raw');
+const reParse = require('remark-parse');
+const reFootnt = require('remark-footnotes');
+const stringify = require('rehype-stringify');
+const remark2rehype = require('remark-rehype');
+const unified = require('unified');
+const parse5 = require('parse5');
+const plugin = require('..');
const renderDefault = text => unified()
.use(reParse)
@@ -26,7 +27,8 @@ const render = text => unified()
.processSync(text);
const renderFootnotes = text => unified()
- .use(reParse, {footnotes: true})
+ .use(reParse)
+ .use(reFootnt, {inlineNotes: true})
.use(plugin, {allowDangerousDOMEventHandlers: false, scope: 'permissive'})
.use(remark2rehype)
.use(stringify)
@@ -35,7 +37,7 @@ const renderFootnotes = text => unified()
const renderRaw = text => unified()
.use(reParse)
.use(plugin, {allowDangerousDOMEventHandlers: false, scope: 'permissive'})
- .use(remark2rehype, {allowDangerousHTML: true})
+ .use(remark2rehype, {allowDangerousHtml: true})
.use(raw)
.use(stringify)
.processSync(text);
@@ -220,7 +222,7 @@ test('linkReference', t => {
});
test('footnote', t => {
- const footnotes = `Since XP is good we should always use XP[^xp]{ data-id=xp }
+ const footnotes = `Since XP is good we should always use XP[^xp]{data-id=xp}
[^xp]: Apply XP principe to XP.
`;