micromark-extension-gfm-strikethrough
Advanced tools
Comparing version 0.5.0 to 0.6.0
61
index.js
module.exports = create | ||
var classifyCharacter = require('micromark/dist/util/classify-character') | ||
var chunkedSplice = require('micromark/dist/util/chunked-splice') | ||
var resolveAll = require('micromark/dist/util/resolve-all') | ||
var shallow = require('micromark/dist/util/shallow') | ||
var resolveAll = require('micromark/dist/util/resolve-all') | ||
@@ -25,3 +26,2 @@ var characterGroupPunctuation = 2 | ||
function resolveAllStrikethrough(events, context) { | ||
var length = events.length | ||
var index = -1 | ||
@@ -33,6 +33,6 @@ var strikethrough | ||
var indexOpen | ||
var eventsUpTo | ||
var nextEvents | ||
// Walk through all events. | ||
while (++index < length) { | ||
while (++index < events.length) { | ||
closing = events[index][1] | ||
@@ -71,13 +71,15 @@ | ||
eventsUpTo = [].concat( | ||
// Before. | ||
events.slice(0, indexOpen - 1), | ||
// Opening. | ||
[ | ||
['enter', strikethrough, context], | ||
['enter', opening, context], | ||
['exit', opening, context], | ||
['enter', text, context] | ||
], | ||
// Between. | ||
// Opening. | ||
nextEvents = [ | ||
['enter', strikethrough, context], | ||
['enter', opening, context], | ||
['exit', opening, context], | ||
['enter', text, context] | ||
] | ||
// Between. | ||
chunkedSplice( | ||
nextEvents, | ||
nextEvents.length, | ||
0, | ||
resolveAll( | ||
@@ -87,16 +89,21 @@ context.parser.constructs.insideSpan.null, | ||
context | ||
), | ||
// Closing. | ||
[ | ||
['exit', text, context], | ||
['enter', closing, context], | ||
['exit', closing, context], | ||
['exit', strikethrough, context] | ||
] | ||
) | ||
) | ||
// After. | ||
events = eventsUpTo.concat(events.slice(index + 2)) | ||
length = events.length | ||
index = eventsUpTo.length - 1 | ||
// Closing. | ||
chunkedSplice(nextEvents, nextEvents.length, 0, [ | ||
['exit', text, context], | ||
['enter', closing, context], | ||
['exit', closing, context], | ||
['exit', strikethrough, context] | ||
]) | ||
chunkedSplice( | ||
events, | ||
indexOpen - 1, | ||
index - indexOpen + 3, | ||
nextEvents | ||
) | ||
index = indexOpen + nextEvents.length - 2 | ||
break | ||
@@ -103,0 +110,0 @@ } |
{ | ||
"name": "micromark-extension-gfm-strikethrough", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "micromark extension to support GFM strikethrough", | ||
@@ -36,3 +36,3 @@ "license": "MIT", | ||
"fault": "^1.0.0", | ||
"micromark": "~2.8.0" | ||
"micromark": "~2.9.0" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
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
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
11990
153
+ Addedmicromark@2.9.2(transitive)
- Removedmicromark@2.8.1(transitive)
Updatedmicromark@~2.9.0