Desktop, Mobile: Improved: Enable more options on multimd-table plugin (#1586)

* Update multimd-table and enable options

* Add `options` option to markdown plugins
pull/1590/head
Caleb John 2019-05-27 12:53:02 -06:00 committed by Laurent Cozic
parent 685a52c2c5
commit a0fb99d78f
3 changed files with 23 additions and 33 deletions

View File

@ -3933,31 +3933,23 @@
"integrity": "sha1-RqGqlHEFrtgYiXjgoBYXnkBPQsc="
},
"markdown-it-multimd-table": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/markdown-it-multimd-table/-/markdown-it-multimd-table-3.1.3.tgz",
"integrity": "sha1-l5Jr4N87WWdhGEZM5D0C03nKNNw=",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/markdown-it-multimd-table/-/markdown-it-multimd-table-3.2.0.tgz",
"integrity": "sha512-dBtYHVtyAnoWslzYLYDh0d9jX2/qroyMIsJ1BjFdIcLgZjzqBIBGwZ1j3AaaWh+IIfe3KVm5Irqn5Uzadm5kQA==",
"requires": {
"markdown-it": "^5.0.3"
"markdown-it": "^8.4.2"
},
"dependencies": {
"linkify-it": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-1.2.4.tgz",
"integrity": "sha1-B3NSbDF8j9E71TTuHRgP+Iq/iBo=",
"requires": {
"uc.micro": "^1.0.1"
}
},
"markdown-it": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-5.1.0.tgz",
"integrity": "sha1-JShrhGW6xJbz8bd+7VRGQ+m9cY0=",
"version": "8.4.2",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz",
"integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==",
"requires": {
"argparse": "~1.0.3",
"argparse": "^1.0.7",
"entities": "~1.1.1",
"linkify-it": "~1.2.0",
"mdurl": "~1.0.1",
"uc.micro": "^1.0.0"
"linkify-it": "^2.0.0",
"mdurl": "^1.0.1",
"uc.micro": "^1.0.5"
}
}
}

View File

@ -117,7 +117,7 @@
"markdown-it-ins": "^2.0.0",
"markdown-it-katex": "^2.0.3",
"markdown-it-mark": "^2.0.0",
"markdown-it-multimd-table": "^3.1.3",
"markdown-it-multimd-table": "^3.2.0",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"markdown-it-toc-done-right": "^3.0.1",

View File

@ -20,18 +20,18 @@ const rules = {
const setupLinkify = require('./MdToHtml/setupLinkify');
const hljs = require('highlight.js');
const markdownItAnchor = require('markdown-it-anchor');
const markdownItToc = require('markdown-it-toc-done-right');
// The keys must match the corresponding entry in Setting.js
const plugins = {
mark: require('markdown-it-mark'),
footnote: require('markdown-it-footnote'),
sub: require('markdown-it-sub'),
sup: require('markdown-it-sup'),
deflist: require('markdown-it-deflist'),
abbr: require('markdown-it-abbr'),
emoji: require('markdown-it-emoji'),
insert: require('markdown-it-ins'),
multitable: require('markdown-it-multimd-table'),
mark: {module: require('markdown-it-mark')},
footnote: {module: require('markdown-it-footnote')},
sub: {module: require('markdown-it-sub')},
sup: {module: require('markdown-it-sup')},
deflist: {module: require('markdown-it-deflist')},
abbr: {module: require('markdown-it-abbr')},
emoji: {module: require('markdown-it-emoji')},
insert: {module: require('markdown-it-ins')},
multitable: {module: require('markdown-it-multimd-table'), options: { enableMultilineRows: true, enableRowspan: true }},
toc: {module: require('markdown-it-toc-done-right'), options: { listType: 'ul' }},
};
class MdToHtml {
@ -129,12 +129,10 @@ class MdToHtml {
markdownIt.use(rules.highlight_keywords(context, ruleOptions));
markdownIt.use(rules.code_inline(context, ruleOptions));
markdownIt.use(markdownItAnchor)
if (Setting.value('markdown.plugin.toc'))
markdownIt.use(markdownItToc, { listType: 'ul' })
for (let key in plugins) {
if (Setting.value('markdown.plugin.' + key))
markdownIt.use(plugins[key]);
markdownIt.use(plugins[key].module, plugins[key].options);
}
setupLinkify(markdownIt);