🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
12
node_modules/micromark-extension-gfm-strikethrough/dev/index.d.ts
generated
vendored
Normal file
12
node_modules/micromark-extension-gfm-strikethrough/dev/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export {gfmStrikethroughHtml} from './lib/html.js'
|
||||
export {gfmStrikethrough, type Options} from './lib/syntax.js'
|
||||
|
||||
declare module 'micromark-util-types' {
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
||||
interface TokenTypeMap {
|
||||
strikethroughSequence: 'strikethroughSequence'
|
||||
strikethroughSequenceTemporary: 'strikethroughSequenceTemporary'
|
||||
strikethrough: 'strikethrough'
|
||||
strikethroughText: 'strikethroughText'
|
||||
}
|
||||
}
|
||||
3
node_modules/micromark-extension-gfm-strikethrough/dev/index.js
generated
vendored
Normal file
3
node_modules/micromark-extension-gfm-strikethrough/dev/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
// Note: more types exposed from `index.d.ts`.
|
||||
export {gfmStrikethroughHtml} from './lib/html.js'
|
||||
export {gfmStrikethrough} from './lib/syntax.js'
|
||||
11
node_modules/micromark-extension-gfm-strikethrough/dev/lib/html.d.ts
generated
vendored
Normal file
11
node_modules/micromark-extension-gfm-strikethrough/dev/lib/html.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
|
||||
*/
|
||||
/**
|
||||
* Extension for `micromark` that can be passed in `htmlExtensions`, to
|
||||
* support GFM strikethrough when serializing to HTML.
|
||||
*
|
||||
* @type {HtmlExtension}
|
||||
*/
|
||||
export const gfmStrikethroughHtml: HtmlExtension
|
||||
export type HtmlExtension = import('micromark-util-types').HtmlExtension
|
||||
24
node_modules/micromark-extension-gfm-strikethrough/dev/lib/html.js
generated
vendored
Normal file
24
node_modules/micromark-extension-gfm-strikethrough/dev/lib/html.js
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
|
||||
*/
|
||||
|
||||
// To do: next major: expose function instead of object.
|
||||
|
||||
/**
|
||||
* Extension for `micromark` that can be passed in `htmlExtensions`, to
|
||||
* support GFM strikethrough when serializing to HTML.
|
||||
*
|
||||
* @type {HtmlExtension}
|
||||
*/
|
||||
export const gfmStrikethroughHtml = {
|
||||
enter: {
|
||||
strikethrough() {
|
||||
this.tag('<del>')
|
||||
}
|
||||
},
|
||||
exit: {
|
||||
strikethrough() {
|
||||
this.tag('</del>')
|
||||
}
|
||||
}
|
||||
}
|
||||
31
node_modules/micromark-extension-gfm-strikethrough/dev/lib/syntax.d.ts
generated
vendored
Normal file
31
node_modules/micromark-extension-gfm-strikethrough/dev/lib/syntax.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* Create an extension for `micromark` to enable GFM strikethrough syntax.
|
||||
*
|
||||
* @param {Options | null | undefined} [options]
|
||||
* Configuration.
|
||||
* @returns {Extension}
|
||||
* Extension for `micromark` that can be passed in `extensions`, to
|
||||
* enable GFM strikethrough syntax.
|
||||
*/
|
||||
export function gfmStrikethrough(
|
||||
options?: Options | null | undefined
|
||||
): Extension
|
||||
export type Event = import('micromark-util-types').Event
|
||||
export type Extension = import('micromark-util-types').Extension
|
||||
export type Resolver = import('micromark-util-types').Resolver
|
||||
export type State = import('micromark-util-types').State
|
||||
export type Token = import('micromark-util-types').Token
|
||||
export type TokenizeContext = import('micromark-util-types').TokenizeContext
|
||||
export type Tokenizer = import('micromark-util-types').Tokenizer
|
||||
/**
|
||||
* Configuration (optional).
|
||||
*/
|
||||
export type Options = {
|
||||
/**
|
||||
* Whether to support strikethrough with a single tilde.
|
||||
*
|
||||
* Single tildes work on github.com, but are technically prohibited by the
|
||||
* GFM spec.
|
||||
*/
|
||||
singleTilde?: boolean
|
||||
}
|
||||
197
node_modules/micromark-extension-gfm-strikethrough/dev/lib/syntax.js
generated
vendored
Normal file
197
node_modules/micromark-extension-gfm-strikethrough/dev/lib/syntax.js
generated
vendored
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
/**
|
||||
* @typedef {import('micromark-util-types').Event} Event
|
||||
* @typedef {import('micromark-util-types').Extension} Extension
|
||||
* @typedef {import('micromark-util-types').Resolver} Resolver
|
||||
* @typedef {import('micromark-util-types').State} State
|
||||
* @typedef {import('micromark-util-types').Token} Token
|
||||
* @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
|
||||
* @typedef {import('micromark-util-types').Tokenizer} Tokenizer
|
||||
*
|
||||
* @typedef Options
|
||||
* Configuration (optional).
|
||||
* @property {boolean} [singleTilde=true]
|
||||
* Whether to support strikethrough with a single tilde.
|
||||
*
|
||||
* Single tildes work on github.com, but are technically prohibited by the
|
||||
* GFM spec.
|
||||
*/
|
||||
|
||||
import {ok as assert} from 'uvu/assert'
|
||||
import {splice} from 'micromark-util-chunked'
|
||||
import {classifyCharacter} from 'micromark-util-classify-character'
|
||||
import {resolveAll} from 'micromark-util-resolve-all'
|
||||
import {codes} from 'micromark-util-symbol/codes.js'
|
||||
import {constants} from 'micromark-util-symbol/constants.js'
|
||||
import {types} from 'micromark-util-symbol/types.js'
|
||||
|
||||
/**
|
||||
* Create an extension for `micromark` to enable GFM strikethrough syntax.
|
||||
*
|
||||
* @param {Options | null | undefined} [options]
|
||||
* Configuration.
|
||||
* @returns {Extension}
|
||||
* Extension for `micromark` that can be passed in `extensions`, to
|
||||
* enable GFM strikethrough syntax.
|
||||
*/
|
||||
export function gfmStrikethrough(options) {
|
||||
const options_ = options || {}
|
||||
let single = options_.singleTilde
|
||||
const tokenizer = {
|
||||
tokenize: tokenizeStrikethrough,
|
||||
resolveAll: resolveAllStrikethrough
|
||||
}
|
||||
|
||||
if (single === null || single === undefined) {
|
||||
single = true
|
||||
}
|
||||
|
||||
return {
|
||||
text: {[codes.tilde]: tokenizer},
|
||||
insideSpan: {null: [tokenizer]},
|
||||
attentionMarkers: {null: [codes.tilde]}
|
||||
}
|
||||
|
||||
/**
|
||||
* Take events and resolve strikethrough.
|
||||
*
|
||||
* @type {Resolver}
|
||||
*/
|
||||
function resolveAllStrikethrough(events, context) {
|
||||
let index = -1
|
||||
|
||||
// Walk through all events.
|
||||
while (++index < events.length) {
|
||||
// Find a token that can close.
|
||||
if (
|
||||
events[index][0] === 'enter' &&
|
||||
events[index][1].type === 'strikethroughSequenceTemporary' &&
|
||||
events[index][1]._close
|
||||
) {
|
||||
let open = index
|
||||
|
||||
// Now walk back to find an opener.
|
||||
while (open--) {
|
||||
// Find a token that can open the closer.
|
||||
if (
|
||||
events[open][0] === 'exit' &&
|
||||
events[open][1].type === 'strikethroughSequenceTemporary' &&
|
||||
events[open][1]._open &&
|
||||
// If the sizes are the same:
|
||||
events[index][1].end.offset - events[index][1].start.offset ===
|
||||
events[open][1].end.offset - events[open][1].start.offset
|
||||
) {
|
||||
events[index][1].type = 'strikethroughSequence'
|
||||
events[open][1].type = 'strikethroughSequence'
|
||||
|
||||
/** @type {Token} */
|
||||
const strikethrough = {
|
||||
type: 'strikethrough',
|
||||
start: Object.assign({}, events[open][1].start),
|
||||
end: Object.assign({}, events[index][1].end)
|
||||
}
|
||||
|
||||
/** @type {Token} */
|
||||
const text = {
|
||||
type: 'strikethroughText',
|
||||
start: Object.assign({}, events[open][1].end),
|
||||
end: Object.assign({}, events[index][1].start)
|
||||
}
|
||||
|
||||
// Opening.
|
||||
/** @type {Array<Event>} */
|
||||
const nextEvents = [
|
||||
['enter', strikethrough, context],
|
||||
['enter', events[open][1], context],
|
||||
['exit', events[open][1], context],
|
||||
['enter', text, context]
|
||||
]
|
||||
|
||||
const insideSpan = context.parser.constructs.insideSpan.null
|
||||
|
||||
if (insideSpan) {
|
||||
// Between.
|
||||
splice(
|
||||
nextEvents,
|
||||
nextEvents.length,
|
||||
0,
|
||||
resolveAll(insideSpan, events.slice(open + 1, index), context)
|
||||
)
|
||||
}
|
||||
|
||||
// Closing.
|
||||
splice(nextEvents, nextEvents.length, 0, [
|
||||
['exit', text, context],
|
||||
['enter', events[index][1], context],
|
||||
['exit', events[index][1], context],
|
||||
['exit', strikethrough, context]
|
||||
])
|
||||
|
||||
splice(events, open - 1, index - open + 3, nextEvents)
|
||||
|
||||
index = open + nextEvents.length - 2
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
index = -1
|
||||
|
||||
while (++index < events.length) {
|
||||
if (events[index][1].type === 'strikethroughSequenceTemporary') {
|
||||
events[index][1].type = types.data
|
||||
}
|
||||
}
|
||||
|
||||
return events
|
||||
}
|
||||
|
||||
/**
|
||||
* @this {TokenizeContext}
|
||||
* @type {Tokenizer}
|
||||
*/
|
||||
function tokenizeStrikethrough(effects, ok, nok) {
|
||||
const previous = this.previous
|
||||
const events = this.events
|
||||
let size = 0
|
||||
|
||||
return start
|
||||
|
||||
/** @type {State} */
|
||||
function start(code) {
|
||||
assert(code === codes.tilde, 'expected `~`')
|
||||
|
||||
if (
|
||||
previous === codes.tilde &&
|
||||
events[events.length - 1][1].type !== types.characterEscape
|
||||
) {
|
||||
return nok(code)
|
||||
}
|
||||
|
||||
effects.enter('strikethroughSequenceTemporary')
|
||||
return more(code)
|
||||
}
|
||||
|
||||
/** @type {State} */
|
||||
function more(code) {
|
||||
const before = classifyCharacter(previous)
|
||||
|
||||
if (code === codes.tilde) {
|
||||
// If this is the third marker, exit.
|
||||
if (size > 1) return nok(code)
|
||||
effects.consume(code)
|
||||
size++
|
||||
return more
|
||||
}
|
||||
|
||||
if (size < 2 && !single) return nok(code)
|
||||
const token = effects.exit('strikethroughSequenceTemporary')
|
||||
const after = classifyCharacter(code)
|
||||
token._open =
|
||||
!after || (after === constants.attentionSideAfter && Boolean(before))
|
||||
token._close =
|
||||
!before || (before === constants.attentionSideAfter && Boolean(after))
|
||||
return ok(code)
|
||||
}
|
||||
}
|
||||
}
|
||||
12
node_modules/micromark-extension-gfm-strikethrough/index.d.ts
generated
vendored
Normal file
12
node_modules/micromark-extension-gfm-strikethrough/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export {gfmStrikethroughHtml} from './lib/html.js'
|
||||
export {gfmStrikethrough, type Options} from './lib/syntax.js'
|
||||
|
||||
declare module 'micromark-util-types' {
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
||||
interface TokenTypeMap {
|
||||
strikethroughSequence: 'strikethroughSequence'
|
||||
strikethroughSequenceTemporary: 'strikethroughSequenceTemporary'
|
||||
strikethrough: 'strikethrough'
|
||||
strikethroughText: 'strikethroughText'
|
||||
}
|
||||
}
|
||||
3
node_modules/micromark-extension-gfm-strikethrough/index.js
generated
vendored
Normal file
3
node_modules/micromark-extension-gfm-strikethrough/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
// Note: more types exposed from `index.d.ts`.
|
||||
export {gfmStrikethroughHtml} from './lib/html.js'
|
||||
export {gfmStrikethrough} from './lib/syntax.js'
|
||||
11
node_modules/micromark-extension-gfm-strikethrough/lib/html.d.ts
generated
vendored
Normal file
11
node_modules/micromark-extension-gfm-strikethrough/lib/html.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
|
||||
*/
|
||||
/**
|
||||
* Extension for `micromark` that can be passed in `htmlExtensions`, to
|
||||
* support GFM strikethrough when serializing to HTML.
|
||||
*
|
||||
* @type {HtmlExtension}
|
||||
*/
|
||||
export const gfmStrikethroughHtml: HtmlExtension
|
||||
export type HtmlExtension = import('micromark-util-types').HtmlExtension
|
||||
24
node_modules/micromark-extension-gfm-strikethrough/lib/html.js
generated
vendored
Normal file
24
node_modules/micromark-extension-gfm-strikethrough/lib/html.js
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
|
||||
*/
|
||||
|
||||
// To do: next major: expose function instead of object.
|
||||
|
||||
/**
|
||||
* Extension for `micromark` that can be passed in `htmlExtensions`, to
|
||||
* support GFM strikethrough when serializing to HTML.
|
||||
*
|
||||
* @type {HtmlExtension}
|
||||
*/
|
||||
export const gfmStrikethroughHtml = {
|
||||
enter: {
|
||||
strikethrough() {
|
||||
this.tag('<del>')
|
||||
}
|
||||
},
|
||||
exit: {
|
||||
strikethrough() {
|
||||
this.tag('</del>')
|
||||
}
|
||||
}
|
||||
}
|
||||
31
node_modules/micromark-extension-gfm-strikethrough/lib/syntax.d.ts
generated
vendored
Normal file
31
node_modules/micromark-extension-gfm-strikethrough/lib/syntax.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* Create an extension for `micromark` to enable GFM strikethrough syntax.
|
||||
*
|
||||
* @param {Options | null | undefined} [options]
|
||||
* Configuration.
|
||||
* @returns {Extension}
|
||||
* Extension for `micromark` that can be passed in `extensions`, to
|
||||
* enable GFM strikethrough syntax.
|
||||
*/
|
||||
export function gfmStrikethrough(
|
||||
options?: Options | null | undefined
|
||||
): Extension
|
||||
export type Event = import('micromark-util-types').Event
|
||||
export type Extension = import('micromark-util-types').Extension
|
||||
export type Resolver = import('micromark-util-types').Resolver
|
||||
export type State = import('micromark-util-types').State
|
||||
export type Token = import('micromark-util-types').Token
|
||||
export type TokenizeContext = import('micromark-util-types').TokenizeContext
|
||||
export type Tokenizer = import('micromark-util-types').Tokenizer
|
||||
/**
|
||||
* Configuration (optional).
|
||||
*/
|
||||
export type Options = {
|
||||
/**
|
||||
* Whether to support strikethrough with a single tilde.
|
||||
*
|
||||
* Single tildes work on github.com, but are technically prohibited by the
|
||||
* GFM spec.
|
||||
*/
|
||||
singleTilde?: boolean
|
||||
}
|
||||
181
node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
generated
vendored
Normal file
181
node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
generated
vendored
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
/**
|
||||
* @typedef {import('micromark-util-types').Event} Event
|
||||
* @typedef {import('micromark-util-types').Extension} Extension
|
||||
* @typedef {import('micromark-util-types').Resolver} Resolver
|
||||
* @typedef {import('micromark-util-types').State} State
|
||||
* @typedef {import('micromark-util-types').Token} Token
|
||||
* @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
|
||||
* @typedef {import('micromark-util-types').Tokenizer} Tokenizer
|
||||
*
|
||||
* @typedef Options
|
||||
* Configuration (optional).
|
||||
* @property {boolean} [singleTilde=true]
|
||||
* Whether to support strikethrough with a single tilde.
|
||||
*
|
||||
* Single tildes work on github.com, but are technically prohibited by the
|
||||
* GFM spec.
|
||||
*/
|
||||
|
||||
import {splice} from 'micromark-util-chunked'
|
||||
import {classifyCharacter} from 'micromark-util-classify-character'
|
||||
import {resolveAll} from 'micromark-util-resolve-all'
|
||||
/**
|
||||
* Create an extension for `micromark` to enable GFM strikethrough syntax.
|
||||
*
|
||||
* @param {Options | null | undefined} [options]
|
||||
* Configuration.
|
||||
* @returns {Extension}
|
||||
* Extension for `micromark` that can be passed in `extensions`, to
|
||||
* enable GFM strikethrough syntax.
|
||||
*/
|
||||
export function gfmStrikethrough(options) {
|
||||
const options_ = options || {}
|
||||
let single = options_.singleTilde
|
||||
const tokenizer = {
|
||||
tokenize: tokenizeStrikethrough,
|
||||
resolveAll: resolveAllStrikethrough
|
||||
}
|
||||
if (single === null || single === undefined) {
|
||||
single = true
|
||||
}
|
||||
return {
|
||||
text: {
|
||||
[126]: tokenizer
|
||||
},
|
||||
insideSpan: {
|
||||
null: [tokenizer]
|
||||
},
|
||||
attentionMarkers: {
|
||||
null: [126]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Take events and resolve strikethrough.
|
||||
*
|
||||
* @type {Resolver}
|
||||
*/
|
||||
function resolveAllStrikethrough(events, context) {
|
||||
let index = -1
|
||||
|
||||
// Walk through all events.
|
||||
while (++index < events.length) {
|
||||
// Find a token that can close.
|
||||
if (
|
||||
events[index][0] === 'enter' &&
|
||||
events[index][1].type === 'strikethroughSequenceTemporary' &&
|
||||
events[index][1]._close
|
||||
) {
|
||||
let open = index
|
||||
|
||||
// Now walk back to find an opener.
|
||||
while (open--) {
|
||||
// Find a token that can open the closer.
|
||||
if (
|
||||
events[open][0] === 'exit' &&
|
||||
events[open][1].type === 'strikethroughSequenceTemporary' &&
|
||||
events[open][1]._open &&
|
||||
// If the sizes are the same:
|
||||
events[index][1].end.offset - events[index][1].start.offset ===
|
||||
events[open][1].end.offset - events[open][1].start.offset
|
||||
) {
|
||||
events[index][1].type = 'strikethroughSequence'
|
||||
events[open][1].type = 'strikethroughSequence'
|
||||
|
||||
/** @type {Token} */
|
||||
const strikethrough = {
|
||||
type: 'strikethrough',
|
||||
start: Object.assign({}, events[open][1].start),
|
||||
end: Object.assign({}, events[index][1].end)
|
||||
}
|
||||
|
||||
/** @type {Token} */
|
||||
const text = {
|
||||
type: 'strikethroughText',
|
||||
start: Object.assign({}, events[open][1].end),
|
||||
end: Object.assign({}, events[index][1].start)
|
||||
}
|
||||
|
||||
// Opening.
|
||||
/** @type {Array<Event>} */
|
||||
const nextEvents = [
|
||||
['enter', strikethrough, context],
|
||||
['enter', events[open][1], context],
|
||||
['exit', events[open][1], context],
|
||||
['enter', text, context]
|
||||
]
|
||||
const insideSpan = context.parser.constructs.insideSpan.null
|
||||
if (insideSpan) {
|
||||
// Between.
|
||||
splice(
|
||||
nextEvents,
|
||||
nextEvents.length,
|
||||
0,
|
||||
resolveAll(insideSpan, events.slice(open + 1, index), context)
|
||||
)
|
||||
}
|
||||
|
||||
// Closing.
|
||||
splice(nextEvents, nextEvents.length, 0, [
|
||||
['exit', text, context],
|
||||
['enter', events[index][1], context],
|
||||
['exit', events[index][1], context],
|
||||
['exit', strikethrough, context]
|
||||
])
|
||||
splice(events, open - 1, index - open + 3, nextEvents)
|
||||
index = open + nextEvents.length - 2
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
index = -1
|
||||
while (++index < events.length) {
|
||||
if (events[index][1].type === 'strikethroughSequenceTemporary') {
|
||||
events[index][1].type = 'data'
|
||||
}
|
||||
}
|
||||
return events
|
||||
}
|
||||
|
||||
/**
|
||||
* @this {TokenizeContext}
|
||||
* @type {Tokenizer}
|
||||
*/
|
||||
function tokenizeStrikethrough(effects, ok, nok) {
|
||||
const previous = this.previous
|
||||
const events = this.events
|
||||
let size = 0
|
||||
return start
|
||||
|
||||
/** @type {State} */
|
||||
function start(code) {
|
||||
if (
|
||||
previous === 126 &&
|
||||
events[events.length - 1][1].type !== 'characterEscape'
|
||||
) {
|
||||
return nok(code)
|
||||
}
|
||||
effects.enter('strikethroughSequenceTemporary')
|
||||
return more(code)
|
||||
}
|
||||
|
||||
/** @type {State} */
|
||||
function more(code) {
|
||||
const before = classifyCharacter(previous)
|
||||
if (code === 126) {
|
||||
// If this is the third marker, exit.
|
||||
if (size > 1) return nok(code)
|
||||
effects.consume(code)
|
||||
size++
|
||||
return more
|
||||
}
|
||||
if (size < 2 && !single) return nok(code)
|
||||
const token = effects.exit('strikethroughSequenceTemporary')
|
||||
const after = classifyCharacter(code)
|
||||
token._open = !after || (after === 2 && Boolean(before))
|
||||
token._close = !before || (before === 2 && Boolean(after))
|
||||
return ok(code)
|
||||
}
|
||||
}
|
||||
}
|
||||
22
node_modules/micromark-extension-gfm-strikethrough/license
generated
vendored
Normal file
22
node_modules/micromark-extension-gfm-strikethrough/license
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
1
node_modules/micromark-extension-gfm-strikethrough/node_modules/.bin/uvu
generated
vendored
Symbolic link
1
node_modules/micromark-extension-gfm-strikethrough/node_modules/.bin/uvu
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../uvu/bin.js
|
||||
110
node_modules/micromark-extension-gfm-strikethrough/package.json
generated
vendored
Normal file
110
node_modules/micromark-extension-gfm-strikethrough/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
{
|
||||
"name": "micromark-extension-gfm-strikethrough",
|
||||
"version": "1.0.7",
|
||||
"description": "micromark extension to support GFM strikethrough",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"micromark",
|
||||
"micromark-extension",
|
||||
"strikethrough",
|
||||
"strike",
|
||||
"through",
|
||||
"del",
|
||||
"delete",
|
||||
"deletion",
|
||||
"gfm",
|
||||
"markdown",
|
||||
"unified"
|
||||
],
|
||||
"repository": "micromark/micromark-extension-gfm-strikethrough",
|
||||
"bugs": "https://github.com/micromark/micromark-extension-gfm-strikethrough/issues",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
},
|
||||
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
|
||||
"contributors": [
|
||||
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"files": [
|
||||
"dev/",
|
||||
"lib/",
|
||||
"index.d.ts",
|
||||
"index.js"
|
||||
],
|
||||
"exports": {
|
||||
"development": "./dev/index.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"micromark-util-chunked": "^1.0.0",
|
||||
"micromark-util-classify-character": "^1.0.0",
|
||||
"micromark-util-resolve-all": "^1.0.0",
|
||||
"micromark-util-symbol": "^1.0.0",
|
||||
"micromark-util-types": "^1.0.0",
|
||||
"uvu": "^0.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.0.0",
|
||||
"c8": "^7.0.0",
|
||||
"create-gfm-fixtures": "^1.0.0",
|
||||
"micromark": "^3.0.0",
|
||||
"micromark-build": "^1.0.0",
|
||||
"prettier": "^2.0.0",
|
||||
"remark-cli": "^11.0.0",
|
||||
"remark-preset-wooorm": "^9.0.0",
|
||||
"tape": "^5.0.0",
|
||||
"type-coverage": "^2.0.0",
|
||||
"typescript": "^5.0.0",
|
||||
"xo": "^0.54.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepack": "npm run build && npm run format",
|
||||
"build": "tsc --build --clean && tsc --build && type-coverage && micromark-build",
|
||||
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
|
||||
"test-api-prod": "node --conditions production test/index.js",
|
||||
"test-api-dev": "node --conditions development test/index.js",
|
||||
"test-api": "npm run test-api-dev && npm run test-api-prod",
|
||||
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
|
||||
"test": "npm run build && npm run format && npm run test-coverage"
|
||||
},
|
||||
"prettier": {
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": true,
|
||||
"bracketSpacing": false,
|
||||
"semi": false,
|
||||
"trailingComma": "none"
|
||||
},
|
||||
"xo": {
|
||||
"prettier": true,
|
||||
"rules": {
|
||||
"n/file-extension-in-import": "off",
|
||||
"max-depth": "off",
|
||||
"unicorn/prefer-node-protocol": "off"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": "test/**/*.js",
|
||||
"rules": {
|
||||
"no-await-in-loop": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"remarkConfig": {
|
||||
"plugins": [
|
||||
"remark-preset-wooorm"
|
||||
]
|
||||
},
|
||||
"typeCoverage": {
|
||||
"atLeast": 100,
|
||||
"detail": true,
|
||||
"strict": true,
|
||||
"ignoreCatch": true
|
||||
}
|
||||
}
|
||||
296
node_modules/micromark-extension-gfm-strikethrough/readme.md
generated
vendored
Normal file
296
node_modules/micromark-extension-gfm-strikethrough/readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,296 @@
|
|||
# micromark-extension-gfm-strikethrough
|
||||
|
||||
[![Build][build-badge]][build]
|
||||
[![Coverage][coverage-badge]][coverage]
|
||||
[![Downloads][downloads-badge]][downloads]
|
||||
[![Size][size-badge]][size]
|
||||
[![Sponsors][sponsors-badge]][collective]
|
||||
[![Backers][backers-badge]][collective]
|
||||
[![Chat][chat-badge]][chat]
|
||||
|
||||
[micromark][] extensions to support GFM [strikethrough][].
|
||||
|
||||
## Contents
|
||||
|
||||
* [What is this?](#what-is-this)
|
||||
* [When to use this](#when-to-use-this)
|
||||
* [Install](#install)
|
||||
* [Use](#use)
|
||||
* [API](#api)
|
||||
* [`gfmStrikethrough(options?)`](#gfmstrikethroughoptions)
|
||||
* [`gfmStrikethroughHtml`](#gfmstrikethroughhtml)
|
||||
* [`Options`](#options)
|
||||
* [Authoring](#authoring)
|
||||
* [HTML](#html)
|
||||
* [CSS](#css)
|
||||
* [Syntax](#syntax)
|
||||
* [Types](#types)
|
||||
* [Compatibility](#compatibility)
|
||||
* [Security](#security)
|
||||
* [Related](#related)
|
||||
* [Contribute](#contribute)
|
||||
* [License](#license)
|
||||
|
||||
## What is this?
|
||||
|
||||
This package contains extensions that add support for strikethrough as enabled
|
||||
by GFM to [`micromark`][micromark].
|
||||
|
||||
## When to use this
|
||||
|
||||
This project is useful when you want to support strikethrough in markdown.
|
||||
|
||||
You can use these extensions when you are working with [`micromark`][micromark].
|
||||
To support all GFM features, use
|
||||
[`micromark-extension-gfm`][micromark-extension-gfm].
|
||||
|
||||
When you need a syntax tree, you can combine this package with
|
||||
[`mdast-util-gfm-strikethrough`][mdast-util-gfm-strikethrough].
|
||||
|
||||
All these packages are used [`remark-gfm`][remark-gfm], which focusses on making
|
||||
it easier to transform content by abstracting these internals away.
|
||||
|
||||
## Install
|
||||
|
||||
This package is [ESM only][esm].
|
||||
In Node.js (version 14.14+), install with [npm][]:
|
||||
|
||||
```sh
|
||||
npm install micromark-extension-gfm-strikethrough
|
||||
```
|
||||
|
||||
In Deno with [`esm.sh`][esmsh]:
|
||||
|
||||
```js
|
||||
import {gfmStrikethrough, gfmStrikethroughHtml} from 'https://esm.sh/micromark-extension-gfm-strikethrough@1'
|
||||
```
|
||||
|
||||
In browsers with [`esm.sh`][esmsh]:
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import {gfmStrikethrough, gfmStrikethroughHtml} from 'https://esm.sh/micromark-extension-gfm-strikethrough@1?bundle'
|
||||
</script>
|
||||
```
|
||||
|
||||
## Use
|
||||
|
||||
```js
|
||||
import {micromark} from 'micromark'
|
||||
import {
|
||||
gfmStrikethrough,
|
||||
gfmStrikethroughHtml
|
||||
} from 'micromark-extension-gfm-strikethrough'
|
||||
|
||||
const output = micromark('Some ~strikethrough~.', {
|
||||
extensions: [gfmStrikethrough()],
|
||||
htmlExtensions: [gfmStrikethroughHtml]
|
||||
})
|
||||
|
||||
console.log(output)
|
||||
```
|
||||
|
||||
Yields:
|
||||
|
||||
```html
|
||||
<p>Some <del>strikethrough</del></p>.
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
This package exports the identifiers
|
||||
[`gfmStrikethrough`][api-gfm-strikethrough] and
|
||||
[`gfmStrikethroughHtml`][api-gfm-strikethrough-html].
|
||||
There is no default export.
|
||||
|
||||
The export map supports the [`development` condition][development].
|
||||
Run `node --conditions development module.js` to get instrumented dev code.
|
||||
Without this condition, production code is loaded.
|
||||
|
||||
### `gfmStrikethrough(options?)`
|
||||
|
||||
Create an extension for `micromark` to enable GFM strikethrough syntax.
|
||||
|
||||
###### Parameters
|
||||
|
||||
* `options` ([`Options`][api-options], optional)
|
||||
— configuration
|
||||
|
||||
###### Returns
|
||||
|
||||
Extension for `micromark` that can be passed in `extensions`, to
|
||||
enable GFM strikethrough syntax ([`Extension`][micromark-extension]).
|
||||
|
||||
### `gfmStrikethroughHtml`
|
||||
|
||||
Extension for `micromark` that can be passed in `htmlExtensions`, to support
|
||||
GFM strikethrough when serializing to HTML
|
||||
([`HtmlExtension`][micromark-html-extension]).
|
||||
|
||||
### `Options`
|
||||
|
||||
Configuration (TypeScript type).
|
||||
|
||||
###### Fields
|
||||
|
||||
* `singleTilde` (`boolean`, default: `true`)
|
||||
— whether to support strikethrough with a single tilde.
|
||||
Single tildes work on github.com, but are technically prohibited by the GFM
|
||||
spec
|
||||
|
||||
## Authoring
|
||||
|
||||
When authoring markdown with strikethrough, it is recommended to use two
|
||||
markers.
|
||||
While `github.com` allows single tildes too, it technically prohibits it in
|
||||
their spec.
|
||||
|
||||
## HTML
|
||||
|
||||
When tilde sequences match, they together relate to the `<del>` element in
|
||||
HTML.
|
||||
See [*§ 4.7.2 The `del` element*][html-del] in the HTML spec for more info.
|
||||
|
||||
## CSS
|
||||
|
||||
GitHub itself does not apply interesting CSS to `del` elements.
|
||||
It currently (July 2022) does change `code` in `del`.
|
||||
|
||||
```css
|
||||
del code {
|
||||
text-decoration: inherit;
|
||||
}
|
||||
```
|
||||
|
||||
For the complete actual CSS see
|
||||
[`sindresorhus/github-markdown-css`][github-markdown-css].
|
||||
|
||||
## Syntax
|
||||
|
||||
Strikethrough sequences form with the following BNF:
|
||||
|
||||
```bnf
|
||||
gfm_attention_sequence ::= 1*'~'
|
||||
```
|
||||
|
||||
Sequences are matched together to form strikethrough based on which character
|
||||
they contain, how long they are, and what character occurs before and after
|
||||
each sequence.
|
||||
Otherwise they are turned into data.
|
||||
|
||||
## Types
|
||||
|
||||
This package is fully typed with [TypeScript][].
|
||||
It exports the additional type [`Options`][api-options].
|
||||
|
||||
## Compatibility
|
||||
|
||||
Projects maintained by the unified collective are compatible with all maintained
|
||||
versions of Node.js.
|
||||
As of now, that is Node.js 14.14+.
|
||||
Our projects sometimes work with older versions, but this is not guaranteed.
|
||||
|
||||
These extensions work with `micromark` version 3+.
|
||||
|
||||
## Security
|
||||
|
||||
This package is safe.
|
||||
|
||||
## Related
|
||||
|
||||
* [`micromark-extension-gfm`][micromark-extension-gfm]
|
||||
— support all of GFM
|
||||
* [`mdast-util-gfm-strikethrough`][mdast-util-gfm-strikethrough]
|
||||
— support all of GFM in mdast
|
||||
* [`mdast-util-gfm`][mdast-util-gfm]
|
||||
— support all of GFM in mdast
|
||||
* [`remark-gfm`][remark-gfm]
|
||||
— support all of GFM in remark
|
||||
|
||||
## Contribute
|
||||
|
||||
See [`contributing.md` in `micromark/.github`][contributing] for ways to get
|
||||
started.
|
||||
See [`support.md`][support] for ways to get help.
|
||||
|
||||
This project has a [code of conduct][coc].
|
||||
By interacting with this repository, organization, or community you agree to
|
||||
abide by its terms.
|
||||
|
||||
## License
|
||||
|
||||
[MIT][license] © [Titus Wormer][author]
|
||||
|
||||
<!-- Definitions -->
|
||||
|
||||
[build-badge]: https://github.com/micromark/micromark-extension-gfm-strikethrough/workflows/main/badge.svg
|
||||
|
||||
[build]: https://github.com/micromark/micromark-extension-gfm-strikethrough/actions
|
||||
|
||||
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm-strikethrough.svg
|
||||
|
||||
[coverage]: https://codecov.io/github/micromark/micromark-extension-gfm-strikethrough
|
||||
|
||||
[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm-strikethrough.svg
|
||||
|
||||
[downloads]: https://www.npmjs.com/package/micromark-extension-gfm-strikethrough
|
||||
|
||||
[size-badge]: https://img.shields.io/bundlephobia/minzip/micromark-extension-gfm-strikethrough.svg
|
||||
|
||||
[size]: https://bundlephobia.com/result?p=micromark-extension-gfm-strikethrough
|
||||
|
||||
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
|
||||
|
||||
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
|
||||
|
||||
[collective]: https://opencollective.com/unified
|
||||
|
||||
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
|
||||
|
||||
[chat]: https://github.com/micromark/micromark/discussions
|
||||
|
||||
[npm]: https://docs.npmjs.com/cli/install
|
||||
|
||||
[esmsh]: https://esm.sh
|
||||
|
||||
[license]: license
|
||||
|
||||
[author]: https://wooorm.com
|
||||
|
||||
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
|
||||
|
||||
[support]: https://github.com/micromark/.github/blob/main/support.md
|
||||
|
||||
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
|
||||
|
||||
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
|
||||
|
||||
[typescript]: https://www.typescriptlang.org
|
||||
|
||||
[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions
|
||||
|
||||
[micromark]: https://github.com/micromark/micromark
|
||||
|
||||
[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension
|
||||
|
||||
[micromark-extension]: https://github.com/micromark/micromark#syntaxextension
|
||||
|
||||
[micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm
|
||||
|
||||
[mdast-util-gfm-strikethrough]: https://github.com/syntax-tree/mdast-util-gfm-strikethrough
|
||||
|
||||
[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm
|
||||
|
||||
[remark-gfm]: https://github.com/remarkjs/remark-gfm
|
||||
|
||||
[strikethrough]: https://github.github.com/gfm/#strikethrough-extension-
|
||||
|
||||
[github-markdown-css]: https://github.com/sindresorhus/github-markdown-css
|
||||
|
||||
[html-del]: https://html.spec.whatwg.org/multipage/edits.html#the-del-element
|
||||
|
||||
[api-gfm-strikethrough]: #gfmstrikethroughoptions
|
||||
|
||||
[api-gfm-strikethrough-html]: #gfmstrikethroughhtml
|
||||
|
||||
[api-options]: #options
|
||||
Loading…
Add table
Add a link
Reference in a new issue