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

markdown-it-directive

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-it-directive - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

25

index.d.ts

@@ -5,9 +5,12 @@ import DefaultMarkdownIt, {PluginSimple} from 'markdown-it';

export type DirectiveAttrs = Record<string, string>;
export type DirectiveDests = ["link"|"string", string][];
interface InlineHandlerArgs {
state: StateInline;
content: string;
dests: Record<string, string>[];
attrs: Record<string, string>[]
contentStart: number;
contentEnd: number;
content: string | undefined;
dests: DirectiveDests | undefined;
attrs: DirectiveAttrs | undefined;
contentStart: number | undefined;
contentEnd: number | undefined;
directiveStart: number;

@@ -20,5 +23,5 @@ directiveEnd: number;

contentTitle: string;
inlineContent: string;
dests: Record<string, string>[];
attrs: Record<string, string>[];
inlineContent: string | undefined;
dests: DirectiveAttrs | undefined;
attrs: DirectiveAttrs | undefined;
contentStartLine?: number;

@@ -28,4 +31,4 @@ contentEndLine?: number;

contentTitleEnd: number;
inlineContentStart: number;
inlineContentEnd: number;
inlineContentStart: number | undefined;
inlineContentEnd: number | undefined;
directiveStartLine: number;

@@ -57,4 +60,4 @@ directiveEndLine: number;

declare function load(): PluginSimple;
declare const load: PluginSimple;
export default load;
'use strict';
const { normalizeReference } = require('markdown-it/lib/common/utils');
const StateInline = require('markdown-it/lib/rules_inline/state_inline');
function isBlank(code) {

@@ -229,3 +226,3 @@ switch (code) {

const refText = src.slice(destsStart + 1, destsEnd);
const ref = state.env.references[normalizeReference(refText)];
const ref = state.env.references[md.utils.normalizeReference(refText)];
if (ref) {

@@ -236,3 +233,3 @@ dests = [ [ 'link', ref.href ], [ 'string', ref.title ] ];

} else {
const ref = state.env.references[normalizeReference(content)];
const ref = state.env.references[md.utils.normalizeReference(content)];
if (ref) {

@@ -346,3 +343,3 @@ dests = [ [ 'link', ref.href ], [ 'string', ref.title ] ];

// which don't have a skipToken method
const inlineState = new StateInline(src, md, state.env, []);
const inlineState = new md.inline.State(src, md, state.env, []);
const rst = parseDirective(inlineState, src, pos, max, true);

@@ -417,3 +414,3 @@ if (rst === null) return false;

function load(md, options) {
function load(md) {
if (md.inlineDirectives) return;

@@ -420,0 +417,0 @@

{
"name": "markdown-it-directive",
"version": "2.0.2",
"version": "2.0.3",
"description": "Directive extension for markdown-it markdown parser.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -0,0 +0,0 @@ # markdown-it-directive

@@ -0,0 +0,0 @@ # markdown-it-directive

Sorry, the diff of this file is not supported yet

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