Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ndla/util

Package Overview
Dependencies
Maintainers
10
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ndla/util - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

11

es/markdownHelpers.js

@@ -12,2 +12,3 @@ /**

export var parseMarkdown = function parseMarkdown(embeddedCaption) {
var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'caption';
var markdown = new Remarkable({

@@ -18,2 +19,12 @@ breaks: true,

markdown.inline.ruler.enable(['sub', 'sup']);
if (parser === 'caption') {
markdown.set({
html: false,
breaks: false
});
markdown.block.ruler.disable(['table', 'footnote', 'blockquote', 'code', 'fences', 'footnote', 'heading', 'hr', 'htmlblock', 'lheading', 'list', 'table']);
markdown.inline.ruler.disable(['autolink', 'backticks', 'del', 'entity', 'escape', 'footnote_ref', 'htmltag', 'links', 'newline', 'text']);
}
var caption = embeddedCaption || '';

@@ -20,0 +31,0 @@ /**

3

lib/markdownHelpers.d.ts

@@ -8,2 +8,3 @@ /**

*/
export declare const parseMarkdown: (embeddedCaption: string) => JSX.Element;
export declare type ParseType = 'caption' | 'body';
export declare const parseMarkdown: (embeddedCaption: string, parser?: ParseType) => JSX.Element;

@@ -23,2 +23,3 @@ "use strict";

var parseMarkdown = function parseMarkdown(embeddedCaption) {
var parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'caption';
var markdown = new _remarkable.Remarkable({

@@ -29,2 +30,12 @@ breaks: true,

markdown.inline.ruler.enable(['sub', 'sup']);
if (parser === 'caption') {
markdown.set({
html: false,
breaks: false
});
markdown.block.ruler.disable(['table', 'footnote', 'blockquote', 'code', 'fences', 'footnote', 'heading', 'hr', 'htmlblock', 'lheading', 'list', 'table']);
markdown.inline.ruler.disable(['autolink', 'backticks', 'del', 'entity', 'escape', 'footnote_ref', 'htmltag', 'links', 'newline', 'text']);
}
var caption = embeddedCaption || '';

@@ -31,0 +42,0 @@ /**

{
"name": "@ndla/util",
"version": "1.0.2",
"version": "1.0.3",
"description": "Collection of util functions used by NDLA",

@@ -36,3 +36,3 @@ "license": "GPL-3.0",

},
"gitHead": "1682299abb08592d13280c3447db580de9b52808"
"gitHead": "e10a8348999df08fd71cc4959e873252395bfea9"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc