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

eslint-plugin-markdown

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-markdown - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

v2.2.0 - May 26, 2021
* [`32203f6`](https://github.com/eslint/eslint-plugin-markdown/commit/32203f6ec86ec5e220d18099863d94408f334665) Update: Replace Markdown parser (fixes #125, fixes #186) (#188) (Brandon Mills)
v2.1.0 - April 25, 2021

@@ -2,0 +6,0 @@

21

lib/processor.js

@@ -14,4 +14,8 @@ /**

* @typedef {Object} RangeMap
* @property {number} js
* @property {number} md
* @property {number} indent Number of code block indent characters trimmed from
* the beginning of the line during extraction.
* @property {number} js Offset from the start of the code block's range in the
* extracted JS.
* @property {number} md Offset from the start of the code block's range in the
* original Markdown.
*

@@ -28,4 +32,3 @@ * @typedef {Object} BlockBase

const unified = require("unified");
const remarkParse = require("remark-parse");
const parse = require("mdast-util-from-markdown");

@@ -38,4 +41,2 @@ const UNSATISFIABLE_RULES = [

const markdown = unified().use(remarkParse);
/**

@@ -158,3 +159,3 @@ * @type {Map<string, Block[]>}

* should normally begin (typically the first column of the line, but more
* inside a list item, for example). The code block's opening fance may be
* inside a list item, for example). The code block's opening fence may be
* further indented by up to three characters. If the code block has

@@ -194,2 +195,3 @@ * additional indenting, the opening fence's first backtick may be up to

const rangeMap = [{
indent: baseIndent,
js: 0,

@@ -223,2 +225,3 @@ md: 0

rangeMap.push({
indent: trimLength,
js: jsOffset,

@@ -248,3 +251,3 @@

function preprocess(text, filename) {
const ast = markdown.parse(text);
const ast = parse(text);
const blocks = [];

@@ -337,3 +340,3 @@

line: lineInCode + blockStart,
column: message.column + block.position.indent[lineInCode - 1] - 1
column: message.column + block.rangeMap[lineInCode].indent
};

@@ -340,0 +343,0 @@

{
"name": "eslint-plugin-markdown",
"version": "2.1.0",
"version": "2.2.0",
"description": "An ESLint plugin to lint JavaScript in Markdown code fences.",

@@ -50,4 +50,3 @@ "license": "MIT",

"dependencies": {
"remark-parse": "^7.0.0",
"unified": "^6.1.2"
"mdast-util-from-markdown": "^0.8.5"
},

@@ -54,0 +53,0 @@ "peerDependencies": {

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