From 0c2f2667d3f202d1a18a751b884e6c3981ab5ae0 Mon Sep 17 00:00:00 2001 From: Caleb John Date: Tue, 2 Apr 2019 10:14:48 -0600 Subject: [PATCH] All: Allow toggling markdown plugins and added several new plugins (#1347) * Initial test of enabling plugins * Added support for toggle-able plugins - Also adds some new plugins * Add instructions on adding toggle-plugins * Fix subtle anchor bug - webview was moving itself when scrolling to bottom anchors * Moves the webview hack so that it only applies to anchors * Add plugin descriptions to the README, also removed mermaid from README * rename plugin.* to markdown.plugin.* to be more forward compatible --- ElectronClient/app/gui/note-viewer/index.html | 2 - ElectronClient/app/package-lock.json | 130 +++++++++++++----- ElectronClient/app/package.json | 11 ++ README.md | 34 ++--- ReactNativeClient/lib/MdToHtml.js | 41 +++++- ReactNativeClient/lib/MdToHtml/webviewLib.js | 13 +- ReactNativeClient/lib/models/Setting.js | 13 ++ ReactNativeClient/package-lock.json | 127 ++++++++++++----- ReactNativeClient/package.json | 11 ++ 9 files changed, 289 insertions(+), 93 deletions(-) diff --git a/ElectronClient/app/gui/note-viewer/index.html b/ElectronClient/app/gui/note-viewer/index.html index f89a24e7368..93a00434c79 100644 --- a/ElectronClient/app/gui/note-viewer/index.html +++ b/ElectronClient/app/gui/note-viewer/index.html @@ -106,7 +106,6 @@ let previousContentHeight = contentElement.scrollHeight; let startTime = Date.now(); - ignoreNextScrollEvent = true; restorePercentScroll(); if (!checkScrollIID_) { @@ -114,7 +113,6 @@ const h = contentElement.scrollHeight; if (h !== previousContentHeight) { previousContentHeight = h; - ignoreNextScrollEvent = true; restorePercentScroll(); } if (Date.now() - startTime >= 1000) { diff --git a/ElectronClient/app/package-lock.json b/ElectronClient/app/package-lock.json index 21aa14cd3fd..0466839dd1f 100644 --- a/ElectronClient/app/package-lock.json +++ b/ElectronClient/app/package-lock.json @@ -464,15 +464,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true, - "optional": true + "dev": true }, "is-glob": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, - "optional": true, "requires": { "is-extglob": "^1.0.0" } @@ -1458,8 +1456,7 @@ }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.3.5", @@ -1481,7 +1478,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -3129,8 +3125,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -3158,7 +3153,6 @@ "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3173,8 +3167,7 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", @@ -3185,8 +3178,7 @@ "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -3303,8 +3295,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -3316,7 +3307,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3331,7 +3321,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -3339,14 +3328,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -3365,7 +3352,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -3446,8 +3432,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -3459,7 +3444,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -3545,8 +3529,7 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -3582,7 +3565,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3602,7 +3584,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3646,14 +3627,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -3759,15 +3738,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true, - "optional": true + "dev": true }, "is-glob": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, - "optional": true, "requires": { "is-extglob": "^1.0.0" } @@ -4727,6 +4704,36 @@ "uc.micro": "^1.0.5" } }, + "markdown-it-abbr": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz", + "integrity": "sha1-1mtTZFIcuz3Yqlna37ovtoZcj9g=" + }, + "markdown-it-anchor": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.0.2.tgz", + "integrity": "sha512-AFM/woBI8QDJMS/9+MmsBMT5/AR+ImfOsunQZTZhzcTmna3rIzAzbOh5E0l6mlFM/i9666BpUtkqQ9bS7WApCg==" + }, + "markdown-it-deflist": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/markdown-it-deflist/-/markdown-it-deflist-2.0.3.tgz", + "integrity": "sha512-/BNZ8ksW42bflm1qQLnRI09oqU2847Z7MVavrR0MORyKLtiUYOMpwtlAfMSZAQU9UCvaUZMpgVAqoS3vpToJxw==" + }, + "markdown-it-emoji": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/markdown-it-emoji/-/markdown-it-emoji-1.4.0.tgz", + "integrity": "sha1-m+4OmpkKljupbfaYDE/dsF37Tcw=" + }, + "markdown-it-footnote": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-footnote/-/markdown-it-footnote-3.0.1.tgz", + "integrity": "sha1-fzcwdHysyG4v4L+KF6cQ80eRUXo=" + }, + "markdown-it-ins": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-ins/-/markdown-it-ins-2.0.0.tgz", + "integrity": "sha1-papqMPHi9x6Ul1Z8/f9A8f3mdIM=" + }, "markdown-it-katex": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/markdown-it-katex/-/markdown-it-katex-2.0.3.tgz", @@ -4745,6 +4752,56 @@ } } }, + "markdown-it-mark": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-mark/-/markdown-it-mark-2.0.0.tgz", + "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=", + "requires": { + "markdown-it": "^5.0.3" + }, + "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=", + "requires": { + "argparse": "~1.0.3", + "entities": "~1.1.1", + "linkify-it": "~1.2.0", + "mdurl": "~1.0.1", + "uc.micro": "^1.0.0" + } + } + } + }, + "markdown-it-sub": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz", + "integrity": "sha1-N1/WAm6ufdywEkl/ZBEZXqHjr+g=" + }, + "markdown-it-sup": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz", + "integrity": "sha1-y5yf+RpSVawI8/09YyhuFd8KH8M=" + }, + "markdown-it-toc-done-right": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-toc-done-right/-/markdown-it-toc-done-right-3.0.1.tgz", + "integrity": "sha512-pppqoXWFyMD/JCLL7YZSYPnxJHr7DH7psXfHzTOXWof8b6XGhbCDYYha6Vi6EDwDEKY+dthNVtMSLHPlk0c1xw==" + }, "match-at": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/match-at/-/match-at-0.1.1.tgz", @@ -5535,8 +5592,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true, - "optional": true + "dev": true }, "is-glob": { "version": "2.0.1", diff --git a/ElectronClient/app/package.json b/ElectronClient/app/package.json index cdb79e104f9..0b23d932681 100644 --- a/ElectronClient/app/package.json +++ b/ElectronClient/app/package.json @@ -107,7 +107,18 @@ "lodash": "^4.17.10", "mark.js": "^8.11.1", "markdown-it": "^8.4.1", + "markdown-it-abbr": "^1.0.4", + "markdown-it-anchor": "^5.0.2", + "markdown-it-deflist": "^2.0.3", + "markdown-it-emoji": "^1.4.0", + "markdown-it-footnote": "^3.0.1", + "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-sub": "^1.0.0", + "markdown-it-sup": "^1.0.0", + "markdown-it-toc-done-right": "^3.0.1", "md5": "^2.2.1", "mime": "^2.3.1", "moment": "^2.22.2", diff --git a/README.md b/README.md index 244ea9e76df..edfbb4e045e 100644 --- a/README.md +++ b/README.md @@ -251,23 +251,23 @@ You can create a link to a note by specifying its ID in the URL. For example: Since getting the ID of a note is not straightforward, each app provides a way to create such link. In the **desktop app**, right click on a note an select "Copy Markdown link". In the **mobile app**, open a note and, in the top right menu, select "Copy Markdown link". You can then paste this link anywhere in another note. -## Charts - -You can create charts in Joplin using the [Mermaid syntax](https://mermaidjs.github.io/). To add such a graph, wrap the Mermaid script inside a "\`\`\`mermaid" code block like this: - - ```mermaid - graph TD; - A-->B; - A-->C; - B-->D; - C-->D; - ``` - -This is how it would look with the Markdown on the left, and rendered graph on the right: - - - -Note that Mermaid graphs are always rendered on a white background regardless of the current theme. This is because they can contain various colours that may not be compatible with the current theme. +## Plugins + +Joplin supports a number of plugins that can be toggled on top the standard markdown features you would expect. These toggle-able plugins are listed below. Note: not all of the plugins are enabled by default, if the enable field is 'no' below, then enter Tools->General Options to enable the plugin. Plugins can be disabled in the same manner. + +| Plugin | Syntax | Description | Enabled | +|--------|--------|-------------|---------| +| [Katex](https://katex.org) | `$$math expr$$` or `$math$` | [See Below](https://github.com/laurent22/joplin#math-notation) | yes | +| [Mark](https://github.com/markdown-it/markdown-it-mark) | `==marked==` | Transforms into `marked` (highlighted) | yes | +| [Footnote](https://github.com/markdown-it/markdown-it-footnote) | `Simples inline footnote ^[I'm inline!]` | See [plugin page](https://github.com/markdown-it/markdown-it-footnote) for full description | yes | +| [TOC](https://github.com/nagaozen/markdown-it-toc-done-right) | Any of `${toc}, [[toc]], [toc], [[_toc_]]` | Adds a table of contents to the location of the toc page. Based on headings and sub-headings | no | +| [Sub](https://github.com/markdown-it/markdown-it-sub) | `X~1~` | Transforms into X1 | no | +| [Sup](https://github.com/markdown-it/markdown-it-sup) | `X^2^` | Transforms into X2 | no | +| [Deflist](https://github.com/markdown-it/markdown-it-deflist) | See [pandoc](http://johnmacfarlane.net/pandoc/README.html#definition-lists) page for syntax | Adds the html `
` tag accessible through markdown | no | +| [Abbr](https://github.com/markdown-it/markdown-it-abbr) | *[HTML]: Hyper Text Markup Language | Allows definition of abbreviations that can be hovered over later for a full expansion | no | +| [Emoji](https://github.com/markdown-it/markdown-it-emoji) | `:smile:` :smile: | See [this list](https://gist.github.com/rxaviers/7360908) for more emoji | no | +| [Insert](https://github.com/markdown-it/markdown-it-ins) | `++inserted++` | Transforms into `inserted` (inserted) | no | +| [Multitable](https://github.com/RedBug312/markdown-it-multimd-table) | See [MultiMarkdown](https://fletcher.github.io/MultiMarkdown-6/syntax/tables.html) page | Adds more power and customization to markdown tables | no | ## Math notation diff --git a/ReactNativeClient/lib/MdToHtml.js b/ReactNativeClient/lib/MdToHtml.js index 226b5459707..0b8875bcc02 100644 --- a/ReactNativeClient/lib/MdToHtml.js +++ b/ReactNativeClient/lib/MdToHtml.js @@ -7,6 +7,7 @@ const { _ } = require('lib/locale'); const md5 = require('md5'); const StringUtils = require('lib/string-utils.js'); const noteStyle = require('./MdToHtml/noteStyle'); +const Setting = require('./models/Setting.js'); const rules = { image: require('./MdToHtml/rules/image'), checkbox: require('./MdToHtml/rules/checkbox'), @@ -19,6 +20,20 @@ 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'), +}; class MdToHtml { @@ -76,14 +91,25 @@ class MdToHtml { const ruleOptions = Object.assign({}, options, { resourceBaseUrl: this.resourceBaseUrl_ }); - // To add a plugin, there are two options: + // To add a plugin, there are three options: // // 1. If the plugin does not need any application specific data, use the standard way: // // const someMarkdownPlugin = require('someMarkdownPlugin'); // markdownIt.use(someMarkdownPlugin); // - // 2. If the plugin needs application data (in ruleOptions) or needs to pass data (CSS, files to load, etc.) back + // 2. If the plugin does not need any application specific data, and you want the user + // to be able to toggle the plugin: + // + // Add the plugin to the plugins object + // const plugins = { + // plugin: require('someMarkdownPlugin'), + // } + // + // And add a corresponding entry into Setting.js + // 'markdown.plugin.mark': {value: true, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable ==mark== syntax')}, + // + // 3. If the plugin needs application data (in ruleOptions) or needs to pass data (CSS, files to load, etc.) back // to the application (using the context object), use the application-specific way: // // const imagePlugin = require('./MdToHtml/rules/image'); @@ -97,9 +123,18 @@ class MdToHtml { markdownIt.use(rules.checkbox(context, ruleOptions)); markdownIt.use(rules.link_open(context, ruleOptions)); markdownIt.use(rules.html_block(context, ruleOptions)); - markdownIt.use(rules.katex(context, ruleOptions)); + if (Setting.value('markdown.plugin.katex')) + markdownIt.use(rules.katex(context, ruleOptions)); 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]); + } setupLinkify(markdownIt); diff --git a/ReactNativeClient/lib/MdToHtml/webviewLib.js b/ReactNativeClient/lib/MdToHtml/webviewLib.js index 01f92c4ebfa..3a19d35c6c7 100644 --- a/ReactNativeClient/lib/MdToHtml/webviewLib.js +++ b/ReactNativeClient/lib/MdToHtml/webviewLib.js @@ -4,7 +4,18 @@ webviewLib.handleInternalLink = function(event, anchorNode) { const href = anchorNode.getAttribute('href'); if (href.indexOf('#') === 0) { event.preventDefault(); + let old_hash = location.hash; + location.hash = href; + + // HACK + // For some reason anchors at the bottom cause the webview to move itself + // so that the content is aligned with the top of the screen + // This basically refreshes the scroll view so that is returns to a normal + // position, the scroll positions stays correct though + // Additionally an anchor could not be clicked twice because the location + // would not change, this fixes that also + setTimeout(function() { location.hash = old_hash; }, 10); return true; } return false; @@ -51,4 +62,4 @@ document.addEventListener('click', function(event) { if (anchor.hasAttribute('data-from-md')) { if (webviewLib.handleInternalLink(event, anchor)) return; } -}); \ No newline at end of file +}); diff --git a/ReactNativeClient/lib/models/Setting.js b/ReactNativeClient/lib/models/Setting.js index 0c2636f83bd..ffdef71807c 100644 --- a/ReactNativeClient/lib/models/Setting.js +++ b/ReactNativeClient/lib/models/Setting.js @@ -96,6 +96,18 @@ class Setting extends BaseModel { 'body': _('Focus body'), }; }}, + 'markdown.plugin.katex': {value: true, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable math expressions')}, + 'markdown.plugin.mark': {value: true, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable ==mark== syntax')}, + 'markdown.plugin.footnote': {value: true, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable footnotes')}, + 'markdown.plugin.toc': {value: true, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable table of contents extension')}, + 'markdown.plugin.sub': {value: false, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable ~sub~ syntax')}, + 'markdown.plugin.sup': {value: false, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable ^sup^ syntax')}, + 'markdown.plugin.deflist': {value: false, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable deflist syntax')}, + 'markdown.plugin.abbr': {value: false, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable abbreviation syntax')}, + 'markdown.plugin.emoji': {value: false, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable markdown emoji')}, + 'markdown.plugin.insert': {value: false, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable ++insert++ syntax')}, + 'markdown.plugin.multitable': {value: false, type: Setting.TYPE_BOOL, section: 'plugins', public: true, appTypes: ['mobile', 'desktop'], label: () => _('Enable multimarkdown table extension')}, + // Tray icon (called AppIndicator) doesn't work in Ubuntu // http://www.webupd8.org/2017/04/fix-appindicator-not-working-for.html @@ -571,6 +583,7 @@ class Setting extends BaseModel { if (name === 'sync') return _('Synchronisation'); if (name === 'appearance') return _('Appearance'); if (name === 'note') return _('Note'); + if (name === 'plugins') return _('Plugins'); if (name === 'application') return _('Application'); return name; } diff --git a/ReactNativeClient/package-lock.json b/ReactNativeClient/package-lock.json index 784e75e96f9..5bfe9e46feb 100644 --- a/ReactNativeClient/package-lock.json +++ b/ReactNativeClient/package-lock.json @@ -2680,8 +2680,7 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true, - "optional": true + "bundled": true }, "aproba": { "version": "1.2.0", @@ -2699,13 +2698,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2718,18 +2715,15 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", @@ -2832,8 +2826,7 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "optional": true + "bundled": true }, "ini": { "version": "1.3.5", @@ -2843,7 +2836,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2856,20 +2848,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.2.4", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2886,7 +2875,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -2959,8 +2947,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "object-assign": { "version": "4.1.1", @@ -2970,7 +2957,6 @@ "once": { "version": "1.4.0", "bundled": true, - "optional": true, "requires": { "wrappy": "1" } @@ -3046,8 +3032,7 @@ }, "safe-buffer": { "version": "5.1.1", - "bundled": true, - "optional": true + "bundled": true }, "safer-buffer": { "version": "2.1.2", @@ -3077,7 +3062,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3095,7 +3079,6 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3134,13 +3117,11 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "yallist": { "version": "3.0.2", - "bundled": true, - "optional": true + "bundled": true } } }, @@ -3882,6 +3863,36 @@ "uc.micro": "^1.0.3" } }, + "markdown-it-abbr": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz", + "integrity": "sha1-1mtTZFIcuz3Yqlna37ovtoZcj9g=" + }, + "markdown-it-anchor": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.0.2.tgz", + "integrity": "sha512-AFM/woBI8QDJMS/9+MmsBMT5/AR+ImfOsunQZTZhzcTmna3rIzAzbOh5E0l6mlFM/i9666BpUtkqQ9bS7WApCg==" + }, + "markdown-it-deflist": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/markdown-it-deflist/-/markdown-it-deflist-2.0.3.tgz", + "integrity": "sha512-/BNZ8ksW42bflm1qQLnRI09oqU2847Z7MVavrR0MORyKLtiUYOMpwtlAfMSZAQU9UCvaUZMpgVAqoS3vpToJxw==" + }, + "markdown-it-emoji": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/markdown-it-emoji/-/markdown-it-emoji-1.4.0.tgz", + "integrity": "sha1-m+4OmpkKljupbfaYDE/dsF37Tcw=" + }, + "markdown-it-footnote": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-footnote/-/markdown-it-footnote-3.0.1.tgz", + "integrity": "sha1-fzcwdHysyG4v4L+KF6cQ80eRUXo=" + }, + "markdown-it-ins": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-ins/-/markdown-it-ins-2.0.0.tgz", + "integrity": "sha1-papqMPHi9x6Ul1Z8/f9A8f3mdIM=" + }, "markdown-it-katex": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/markdown-it-katex/-/markdown-it-katex-2.0.3.tgz", @@ -3900,6 +3911,56 @@ } } }, + "markdown-it-mark": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-mark/-/markdown-it-mark-2.0.0.tgz", + "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=", + "requires": { + "markdown-it": "^5.0.3" + }, + "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=", + "requires": { + "argparse": "~1.0.3", + "entities": "~1.1.1", + "linkify-it": "~1.2.0", + "mdurl": "~1.0.1", + "uc.micro": "^1.0.0" + } + } + } + }, + "markdown-it-sub": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz", + "integrity": "sha1-N1/WAm6ufdywEkl/ZBEZXqHjr+g=" + }, + "markdown-it-sup": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz", + "integrity": "sha1-y5yf+RpSVawI8/09YyhuFd8KH8M=" + }, + "markdown-it-toc-done-right": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-toc-done-right/-/markdown-it-toc-done-right-3.0.1.tgz", + "integrity": "sha512-pppqoXWFyMD/JCLL7YZSYPnxJHr7DH7psXfHzTOXWof8b6XGhbCDYYha6Vi6EDwDEKY+dthNVtMSLHPlk0c1xw==" + }, "match-at": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/match-at/-/match-at-0.1.1.tgz", @@ -4062,7 +4123,7 @@ }, "load-json-file": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "requires": { "graceful-fs": "^4.1.2", @@ -5217,7 +5278,7 @@ }, "load-json-file": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "requires": { "graceful-fs": "^4.1.2", @@ -7311,7 +7372,7 @@ "dependencies": { "uuid": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", "integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=" } } diff --git a/ReactNativeClient/package.json b/ReactNativeClient/package.json index 2da8b24c7a1..2fd439b5db4 100644 --- a/ReactNativeClient/package.json +++ b/ReactNativeClient/package.json @@ -19,7 +19,18 @@ "html-entities": "^1.2.1", "katex": "^0.10.0", "markdown-it": "^8.4.0", + "markdown-it-abbr": "^1.0.4", + "markdown-it-anchor": "^5.0.2", + "markdown-it-deflist": "^2.0.3", + "markdown-it-emoji": "^1.4.0", + "markdown-it-footnote": "^3.0.1", + "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-sub": "^1.0.0", + "markdown-it-sup": "^1.0.0", + "markdown-it-toc-done-right": "^3.0.1", "md5": "^2.2.1", "moment": "^2.18.1", "prop-types": "^15.6.0",