Skip to content

Commit

Permalink
build(deps): Upgrade remarkable to 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Conrad Chan committed Feb 22, 2021
1 parent 4f70945 commit a377eca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/lib/viewers/text/MarkdownViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ class MarkdownViewer extends PlainTextViewer {
* @return {Remarkable} Remarkable parser instance
*/
initRemarkable() {
/* global Remarkable */
/* global remarkable */
const { linkify, Remarkable } = remarkable;
/* istanbul ignore next */
const md = new Remarkable({
breaks: true, // convert '\n' in paragraphs into <br>
linkify: true, // automatically URL-like text into links
linkTarget: '_blank', // open links in new page
typographer: true,
/* global hljs */
Expand All @@ -133,7 +133,7 @@ class MarkdownViewer extends PlainTextViewer {
// Use default escaping if no highlighting was successful
return '';
},
});
}).use(linkify); // automatically converts URL-like text into links

// Custom renderer for links to add rel="noopener noreferrer"
const linkRenderer = md.renderer.rules.link_open;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/viewers/text/__tests__/MarkdownViewer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ControlsRoot from '../../controls/controls-root';
import MarkdownControls from '../MarkdownControls';
import MarkdownViewer from '../MarkdownViewer';
import Popup from '../../../Popup';
import Remarkable from '../../../../third-party/text/0.114.0/remarkable.min.js';
import { linkify, Remarkable } from '../../../../third-party/text/2.64.0/remarkable.min.js';
import { TEXT_STATIC_ASSETS_VERSION, SELECTOR_BOX_PREVIEW } from '../../../constants';
import { VIEWER_EVENT } from '../../../events';

Expand All @@ -19,7 +19,7 @@ describe('lib/viewers/text/MarkdownViewer', () => {
const setupFunc = BaseViewer.prototype.setup;

beforeAll(() => {
global.Remarkable = Remarkable;
global.remarkable = { linkify, Remarkable };
});

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/third-party/text/2.64.0/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"dependencies": {
"highlightjs": "9.18.1",
"papaparse": "4.1.2",
"remarkable": "1.7.1"
"remarkable": "2.0.1"
}
}
5 changes: 1 addition & 4 deletions src/third-party/text/2.64.0/remarkable.min.js

Large diffs are not rendered by default.

0 comments on commit a377eca

Please sign in to comment.