remark-stringify
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -9,4 +9,2 @@ 'use strict'; | ||
var FENCE = /([`~])\1{2}/; | ||
/* Stringify code. | ||
@@ -31,8 +29,7 @@ * Creates indented code when: | ||
* | ||
* Knows about internal fences (Note: GitHub/Kramdown does | ||
* not support this): | ||
* Knows about internal fences: | ||
* | ||
* ````javascript | ||
* ```markdown | ||
* foo | ||
* ````markdown | ||
* ```javascript | ||
* foo(); | ||
* ``` | ||
@@ -65,16 +62,5 @@ * ```` | ||
fence = streak(value, marker) + 1; | ||
fence = repeat(marker, Math.max(streak(value, marker) + 1, 3)); | ||
/* Fix GFM / RedCarpet bug, where fence-like characters | ||
* inside fenced code can exit a code-block. | ||
* Yes, even when the outer fence uses different | ||
* characters, or is longer. | ||
* Thus, we can only pad the code to make it work. */ | ||
if (FENCE.test(value)) { | ||
value = pad(value, 1); | ||
} | ||
fence = repeat(marker, Math.max(fence, 3)); | ||
return fence + language + '\n' + value + '\n' + fence; | ||
} |
{ | ||
"name": "remark-stringify", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "Markdown compiler for remark", | ||
@@ -15,4 +15,4 @@ "license": "MIT", | ||
"homepage": "http://remark.js.org", | ||
"repository": "https://github.com/wooorm/remark/tree/master/packages/remark-stringify", | ||
"bugs": "https://github.com/wooorm/remark/issues", | ||
"repository": "https://github.com/remarkjs/remark/tree/master/packages/remark-stringify", | ||
"bugs": "https://github.com/remarkjs/remark/issues", | ||
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
@@ -19,0 +19,0 @@ "contributors": [ |
@@ -183,7 +183,7 @@ # remark-stringify [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat] | ||
If this plug-in is used, it adds a [`Compiler`][compiler] constructor | ||
to the `processor`. Other plug-ins can change and add visitors on | ||
If this plugin is used, it adds a [`Compiler`][compiler] constructor | ||
to the `processor`. Other plugins can change and add visitors on | ||
the compiler’s prototype to change how markdown is stringified. | ||
The below plug-in modifies a [visitor][] to add an extra blank line | ||
The below plugin modifies a [visitor][] to add an extra blank line | ||
before level two headings. | ||
@@ -197,8 +197,6 @@ | ||
var visitors = Compiler.prototype.visitors; | ||
var heading = visitors.heading; | ||
var original = visitors.heading; | ||
visitors.heading = heading; | ||
function heading(node) { | ||
return (node.depth === 2 ? '\n' : '') + heading.apply(this, arguments); | ||
visitors.heading = function heading(node) { | ||
return (node.depth === 2 ? '\n' : '') + original.apply(this, arguments); | ||
} | ||
@@ -231,15 +229,15 @@ } | ||
[build-badge]: https://img.shields.io/travis/wooorm/remark.svg | ||
[build-badge]: https://img.shields.io/travis/remarkjs/remark.svg | ||
[build-status]: https://travis-ci.org/wooorm/remark | ||
[build-status]: https://travis-ci.org/remarkjs/remark | ||
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark.svg | ||
[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark.svg | ||
[coverage-status]: https://codecov.io/github/wooorm/remark | ||
[coverage-status]: https://codecov.io/github/remarkjs/remark | ||
[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg | ||
[chat-badge]: https://img.shields.io/gitter/room/remarkjs/Lobby.svg | ||
[chat]: https://gitter.im/wooorm/remark | ||
[chat]: https://gitter.im/remarkjs/Lobby | ||
[license]: https://github.com/wooorm/remark/blob/master/LICENSE | ||
[license]: https://github.com/remarkjs/remark/blob/master/LICENSE | ||
@@ -250,13 +248,13 @@ [author]: http://wooorm.com | ||
[unified]: https://github.com/wooorm/unified | ||
[unified]: https://github.com/unifiedjs/unified | ||
[processor]: https://github.com/wooorm/remark | ||
[processor]: https://github.com/remarkjs/remark | ||
[data]: https://github.com/unifiedjs/unified#processordatakey-value | ||
[compiler]: https://github.com/wooorm/unified#processorcompiler | ||
[compiler]: https://github.com/unifiedjs/unified#processorcompiler | ||
[mdast]: https://github.com/wooorm/mdast | ||
[mdast]: https://github.com/syntax-tree/mdast | ||
[node]: https://github.com/wooorm/unist#node | ||
[node]: https://github.com/syntax-tree/unist#node | ||
@@ -263,0 +261,0 @@ [extend]: #extending-the-compiler |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
42553
1202
264