New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mdast

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdast - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

8

History.md
0.5.1 / 2015-02-19
==================
* Remove ATX headers when not followed by white space
* Fix miscellaneous emphasis issues
* Fix empty list-item from throwing
* Fix miscellaneous horizontal rule issues
0.5.0 / 2015-02-17

@@ -3,0 +11,0 @@ ==================

16

lib/expressions.js

@@ -7,4 +7,4 @@ /* This file is generated by `script/build-expressions.js` */

"code":/^((?: {4}|\t)[^\n]+\n*)+/,
"horizontalRule":/^( *[-*_]){3,} *(?=\n|$)/,
"heading":/^ *((#{1,6}) *)([^\n]+?) *#* *(?=\n|$)/,
"horizontalRule":/^ *([-*_])( *\1){2,} *(?=\n|$)/,
"heading":/^ *((#{1,6})[ \t]+)([^\n]+?) *#* *(?=\n|$)/,
"lineHeading":/^([^\n]+)\n *(=|-){2,} *(?=\n|$)/,

@@ -17,3 +17,3 @@ "linkDefinition":/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?=\n|$)/,

"html":/^[ \t]*(?:<!--[\s\S]*?-->[ \t]*(?:\n|\s*$)|<((?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)\w+(?!:\/|[^\w\s@]*@)\b)[\s\S]+?<\/\1>[ \t]*(?:\n{2,}|\s*$)|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)\w+(?!:\/|[^\w\s@]*@)\b(?:"[^"]*"|'[^']*'|[^'">])*?>[ \t]*(?:\n{2,}|\s*$))/,
"paragraph":/^(?:(?:[^\n]+\n?(?!( *[-*_]){3,} *(?=\n|$)| *((#{1,6}) *)([^\n]+?) *#* *(?=\n|$)|([^\n]+)\n *(=|-){2,} *(?=\n|$)|([ \t]*>[^\n]+(\n(?! *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?=\n|$))[^\n]+)*)+|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)\w+(?!:\/|[^\w\s@]*@)\b| *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?=\n|$)))+)/,
"paragraph":/^(?:(?:[^\n]+\n?(?! *([-*_])( *\1){2,} *(?=\n|$)| *((#{1,6})[ \t]+)([^\n]+?) *#* *(?=\n|$)|([^\n]+)\n *(=|-){2,} *(?=\n|$)|([ \t]*>[^\n]+(\n(?! *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?=\n|$))[^\n]+)*)+|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)\w+(?!:\/|[^\w\s@]*@)\b| *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?=\n|$)))+)/,
"escape":/^\\([\\`*{}\[\]()#+\-.!_>])/,

@@ -23,4 +23,4 @@ "autoLink":/^<([^ >]+(@|:\/)[^ >]+)>/,

"invalidLink":/^(!?\[)((?:\[[^\]]*\]|[^\[\]])*)\]/,
"strong":/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
"emphasis":/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
"strong":/^(_)_([\s\S]+?)__(?!_)|^(\*)\*([\s\S]+?)\*\*(?!\*)/,
"emphasis":/^\b(_)((?:__|[\s\S])+?)_\b|^(\*)((?:\*\*|[\s\S])+?)\*(?!\*)/,
"inlineCode":/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,

@@ -40,3 +40,3 @@ "break":/^ {2,}\n(?!\s*$)/,

"fences":/^[ \\t]*(`{3,}|~{3,})[ \\t]*(\S+)?[ \\t]*\n([\s\S]*?)\s*\1[ \\t]*(?=\n|$)/,
"paragraph":/^(?:(?:[^\n]+\n?(?![ \\t]*(`{3,}|~{3,})[ \\t]*(\S+)?[ \\t]*\n([\s\S]*?)\s*\2[ \\t]*(?=\n|$)|([ \t]*)((?:[*+-]|\d+\.))((?:[ \t][\s\S]+?)(?:\n+(?=\3?(?:[-*_][ \t]*){3,}(?=\n|$))|\n+(?= *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?=\n|$))|\n{2,}(?![ \t])(?!\1(?:[*+-]|\d+\.)[ \t])|\s*$))|( *[-*_]){3,} *(?=\n|$)| *((#{1,6}) *)([^\n]+?) *#* *(?=\n|$)|([^\n]+)\n *(=|-){2,} *(?=\n|$)|([ \t]*>[^\n]+(\n(?! *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?=\n|$))[^\n]+)*)+|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)\w+(?!:\/|[^\w\s@]*@)\b| *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?=\n|$)))+)/,
"paragraph":/^(?:(?:[^\n]+\n?(?![ \\t]*(`{3,}|~{3,})[ \\t]*(\S+)?[ \\t]*\n([\s\S]*?)\s*\2[ \\t]*(?=\n|$)|([ \t]*)((?:[*+-]|\d+\.))((?:[ \t][\s\S]+?)(?:\n+(?=\3?(?:[-*_][ \t]*){3,}(?=\n|$))|\n+(?= *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?=\n|$))|\n{2,}(?![ \t])(?!\1(?:[*+-]|\d+\.)[ \t])|\s*$))| *([-*_])( *\1){2,} *(?=\n|$)| *((#{1,6})[ \t]+)([^\n]+?) *#* *(?=\n|$)|([^\n]+)\n *(=|-){2,} *(?=\n|$)|([ \t]*>[^\n]+(\n(?! *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?=\n|$))[^\n]+)*)+|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)\w+(?!:\/|[^\w\s@]*@)\b| *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?=\n|$)))+)/,
"escape":/^\\([\\`*{}\[\]()#+\-.!_>~|])/,

@@ -54,4 +54,4 @@ "url":/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,

"pedantic": {
"strong":/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
"emphasis":/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/
"strong":/^(_)_(?=\S)([\s\S]*?\S)__(?!_)|^(\*)\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
"emphasis":/^(_)(?=\S)([\s\S]*?\S)_(?!_)|^(\*)(?=\S)([\s\S]*?\S)\*(?!\*)/
},

@@ -58,0 +58,0 @@ "breaks": {

@@ -18,2 +18,3 @@ 'use strict';

var raise = utilities.raise;
var trim = utilities.trim;
var trimRight = utilities.trimRight;

@@ -367,3 +368,3 @@ var trimRightLines = utilities.trimRightLines;

var firstBullet = $2;
var matches = trimRight($0).match(self.rules.item);
var matches = trimRightLines($0).match(self.rules.item);
var length = matches.length;

@@ -418,7 +419,8 @@ var index = -1;

eat(NEW_LINE);
if (index !== length - 1) {
eat(NEW_LINE);
}
}
list.position.end.line = item.position.end.line;
list.position.end.column = item.position.end.column;
list.position.end = eat.now();

@@ -825,2 +827,3 @@ enterTop();

lines[index].length - trimmedLines[index].length;
line++;

@@ -1208,11 +1211,18 @@ }

* @param {string} $0 - Whole emphasis.
* @param {string?} $1 - Content.
* @param {string?} $1 - Marker.
* @param {string?} $2 - Content.
* @param {string?} $3 - Marker.
* @param {string?} $4 - Content.
*/
function tokenizeStrong(eat, $0, $1, $2) {
function tokenizeStrong(eat, $0, $1, $2, $3, $4) {
var now = eat.now();
var value = $2 || $4;
if (trim(value) === EMPTY) {
return;
}
now.column += 2;
eat($0)(this.renderInline(STRONG, $2 || $1, now));
eat($0)(this.renderInline(STRONG, value, now));
}

@@ -1225,11 +1235,23 @@

* @param {string} $0 - Whole emphasis.
* @param {string?} $1 - Content.
* @param {string?} $1 - Marker.
* @param {string?} $2 - Content.
* @param {string?} $3 - Marker.
* @param {string?} $4 - Content.
*/
function tokenizeEmphasis(eat, $0, $1, $2) {
function tokenizeEmphasis(eat, $0, $1, $2, $3, $4) {
var now = eat.now();
var marker = $1 || $3;
var value = $2 || $4;
if (
trim(value) === EMPTY ||
value.charAt(0) === marker ||
value.charAt(value.length - 1) === marker
) {
return;
}
now.column += 1;
eat($0)(this.renderInline(EMPHASIS, $2 || $1, now));
eat($0)(this.renderInline(EMPHASIS, value, now));
}

@@ -1491,4 +1513,4 @@

'heading',
'horizontalRule',
'lineHeading',
'horizontalRule',
'blockquote',

@@ -1495,0 +1517,0 @@ 'list',

@@ -154,2 +154,12 @@ 'use strict';

/**
* Remove initial and final white space from `value`.
*
* @param {string} value
* @return {string}
*/
function trim(value) {
return trimLeft(trimRight(value));
}
/**
* Clean a string in preperation of parsing.

@@ -210,2 +220,3 @@ *

exports.trim = trim;
exports.trimLeft = trimLeft;

@@ -212,0 +223,0 @@ exports.trimRight = trimRight;

{
"name": "mdast",
"version": "0.5.0",
"version": "0.5.1",
"description": "Speedy Markdown parser/stringifier for multipurpose analysis",

@@ -5,0 +5,0 @@ "license": "MIT",

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