diff options
author | Romulus Tsai 蔡仲明 <urakagi@gmail.com> | 2020-05-08 09:35:11 +0800 |
---|---|---|
committer | Romulus Tsai 蔡仲明 <urakagi@gmail.com> | 2020-05-08 09:35:11 +0800 |
commit | cfcc73724fcd394150d1b815d0a7a4c466e216b5 (patch) | |
tree | a9648255f14cd8b0e1ad8eee1f8d42337a0668bc /packages/markdown/marked/test/specs/commonmark/getSpecs.js | |
parent | a3658993128bdddd5d40f792c19281dc5eac51f5 (diff) | |
parent | 533bc045d06269dba2f42cdfe61817a1b3407974 (diff) | |
download | wekan-cfcc73724fcd394150d1b815d0a7a4c466e216b5.tar.gz wekan-cfcc73724fcd394150d1b815d0a7a4c466e216b5.tar.bz2 wekan-cfcc73724fcd394150d1b815d0a7a4c466e216b5.zip |
Merge branch 'master' of https://github.com/wekan/wekan
Diffstat (limited to 'packages/markdown/marked/test/specs/commonmark/getSpecs.js')
-rw-r--r-- | packages/markdown/marked/test/specs/commonmark/getSpecs.js | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/packages/markdown/marked/test/specs/commonmark/getSpecs.js b/packages/markdown/marked/test/specs/commonmark/getSpecs.js deleted file mode 100644 index f22e00c0..00000000 --- a/packages/markdown/marked/test/specs/commonmark/getSpecs.js +++ /dev/null @@ -1,24 +0,0 @@ -const fetch = require('node-fetch'); -const marked = require('../../../'); -const htmlDiffer = require('../../helpers/html-differ.js'); -const fs = require('fs'); - -fetch('https://raw.githubusercontent.com/commonmark/commonmark.js/master/package.json') - .then(res => res.json()) - .then(pkg => pkg.version.replace(/^(\d+\.\d+).*$/, '$1')) - .then(version => - fetch(`https://spec.commonmark.org/${version}/spec.json`) - .then(res => res.json()) - .then(specs => { - specs.forEach(spec => { - const html = marked(spec.markdown, {headerIds: false}); - if (!htmlDiffer.isEqual(html, spec.html)) { - spec.shouldFail = true; - } - }); - fs.writeFileSync(`commonmark.${version}.json`, JSON.stringify(specs, null, 2) + '\n'); - }) - ) - .catch((err) => { - console.error(err); - }); |