Socket
Socket
Sign inDemoInstall

micromark-extension-gfm-strikethrough

Package Overview
Dependencies
199
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

24

dev/lib/syntax.js

@@ -19,2 +19,3 @@ /**

import assert from 'power-assert'
import {splice} from 'micromark-util-chunked'

@@ -55,10 +56,2 @@ import {classifyCharacter} from 'micromark-util-classify-character'

let index = -1
/** @type {Token} */
let strikethrough
/** @type {Token} */
let text
/** @type {number} */
let open
/** @type {Event[]} */
let nextEvents

@@ -73,3 +66,3 @@ // Walk through all events.

) {
open = index
let open = index

@@ -90,3 +83,3 @@ // Now walk back to find an opener.

strikethrough = {
const strikethrough = {
type: 'strikethrough',

@@ -97,3 +90,3 @@ start: Object.assign({}, events[open][1].start),

text = {
const text = {
type: 'strikethroughText',

@@ -105,3 +98,3 @@ start: Object.assign({}, events[open][1].end),

// Opening.
nextEvents = [
const nextEvents = [
['enter', strikethrough, context],

@@ -163,6 +156,7 @@ ['enter', events[open][1], context],

function start(code) {
assert(code === codes.tilde, 'expected `~`')
if (
code !== codes.tilde ||
(previous === codes.tilde &&
events[events.length - 1][1].type !== types.characterEscape)
previous === codes.tilde &&
events[events.length - 1][1].type !== types.characterEscape
) {

@@ -169,0 +163,0 @@ return nok(code)

@@ -55,16 +55,4 @@ /**

function resolveAllStrikethrough(events, context) {
let index = -1
/** @type {Token} */
let index = -1 // Walk through all events.
let strikethrough
/** @type {Token} */
let text
/** @type {number} */
let open
/** @type {Event[]} */
let nextEvents // Walk through all events.
while (++index < events.length) {

@@ -77,3 +65,3 @@ // Find a token that can close.

) {
open = index // Now walk back to find an opener.
let open = index // Now walk back to find an opener.

@@ -91,3 +79,3 @@ while (open--) {

events[open][1].type = 'strikethroughSequence'
strikethrough = {
const strikethrough = {
type: 'strikethrough',

@@ -97,3 +85,3 @@ start: Object.assign({}, events[open][1].start),

}
text = {
const text = {
type: 'strikethroughText',

@@ -104,3 +92,3 @@ start: Object.assign({}, events[open][1].end),

nextEvents = [
const nextEvents = [
['enter', strikethrough, context],

@@ -158,5 +146,4 @@ ['enter', events[open][1], context],

if (
code !== 126 ||
(previous === 126 &&
events[events.length - 1][1].type !== 'characterEscape')
previous === 126 &&
events[events.length - 1][1].type !== 'characterEscape'
) {

@@ -163,0 +150,0 @@ return nok(code)

{
"name": "micromark-extension-gfm-strikethrough",
"version": "1.0.1",
"version": "1.0.2",
"description": "micromark extension to support GFM strikethrough",

@@ -48,5 +48,7 @@ "license": "MIT",

"micromark-util-symbol": "^1.0.0",
"micromark-util-types": "^1.0.0"
"micromark-util-types": "^1.0.0",
"power-assert": "^1.0.0"
},
"devDependencies": {
"@types/power-assert": "^1.0.0",
"@types/tape": "^4.0.0",

@@ -63,3 +65,3 @@ "c8": "^7.0.0",

"typescript": "^4.0.0",
"xo": "^0.44.0"
"xo": "^0.45.0"
},

@@ -66,0 +68,0 @@ "scripts": {

@@ -63,3 +63,3 @@ # micromark-extension-gfm-strikethrough

The export map supports the endorsed
[`development` condition](https://nodejs.org/api/packages.html#packages_resolving_user_conditions).
[`development` condition](https://nodejs.org/api/packages.html#packages\_resolving\_user\_conditions).
Run `node --conditions development module.js` to get instrumented dev code.

@@ -66,0 +66,0 @@ Without this condition, production code is loaded.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc