Refactor routing in App component to enhance navigation and improve error handling by integrating dynamic routes and updating the NotFound route.
This commit is contained in:
30
node_modules/micromark-extension-gfm-strikethrough/dev/index.d.ts
generated
vendored
Normal file
30
node_modules/micromark-extension-gfm-strikethrough/dev/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
export {gfmStrikethroughHtml} from './lib/html.js'
|
||||
export {gfmStrikethrough} from './lib/syntax.js'
|
||||
|
||||
/**
|
||||
* Configuration (optional).
|
||||
*/
|
||||
export interface Options {
|
||||
/**
|
||||
* Whether to support strikethrough with a single tilde (default: `true`).
|
||||
*
|
||||
* Single tildes work on github.com, but are technically prohibited by the
|
||||
* GFM spec.
|
||||
*/
|
||||
singleTilde?: boolean | null | undefined
|
||||
}
|
||||
|
||||
/**
|
||||
* Augment.
|
||||
*/
|
||||
declare module 'micromark-util-types' {
|
||||
/**
|
||||
* Token types.
|
||||
*/
|
||||
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'
|
13
node_modules/micromark-extension-gfm-strikethrough/dev/lib/html.d.ts
generated
vendored
Normal file
13
node_modules/micromark-extension-gfm-strikethrough/dev/lib/html.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @import {HtmlExtension} from 'micromark-util-types'
|
||||
*/
|
||||
/**
|
||||
* Create an HTML extension for `micromark` to support GFM strikethrough when
|
||||
* serializing to HTML.
|
||||
*
|
||||
* @returns {HtmlExtension}
|
||||
* Extension for `micromark` that can be passed in `htmlExtensions`, to
|
||||
* support GFM strikethrough when serializing to HTML.
|
||||
*/
|
||||
export function gfmStrikethroughHtml(): HtmlExtension;
|
||||
import type { HtmlExtension } from 'micromark-util-types';
|
26
node_modules/micromark-extension-gfm-strikethrough/dev/lib/html.js
generated
vendored
Normal file
26
node_modules/micromark-extension-gfm-strikethrough/dev/lib/html.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @import {HtmlExtension} from 'micromark-util-types'
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create an HTML extension for `micromark` to support GFM strikethrough when
|
||||
* serializing to HTML.
|
||||
*
|
||||
* @returns {HtmlExtension}
|
||||
* Extension for `micromark` that can be passed in `htmlExtensions`, to
|
||||
* support GFM strikethrough when serializing to HTML.
|
||||
*/
|
||||
export function gfmStrikethroughHtml() {
|
||||
return {
|
||||
enter: {
|
||||
strikethrough() {
|
||||
this.tag('<del>')
|
||||
}
|
||||
},
|
||||
exit: {
|
||||
strikethrough() {
|
||||
this.tag('</del>')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
12
node_modules/micromark-extension-gfm-strikethrough/dev/lib/syntax.d.ts
generated
vendored
Normal file
12
node_modules/micromark-extension-gfm-strikethrough/dev/lib/syntax.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 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;
|
||||
import type { Options } from 'micromark-extension-gfm-strikethrough';
|
||||
import type { Extension } from 'micromark-util-types';
|
183
node_modules/micromark-extension-gfm-strikethrough/dev/lib/syntax.js
generated
vendored
Normal file
183
node_modules/micromark-extension-gfm-strikethrough/dev/lib/syntax.js
generated
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
/**
|
||||
* @import {Options} from 'micromark-extension-gfm-strikethrough'
|
||||
* @import {Event, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
|
||||
*/
|
||||
|
||||
import {ok as assert} from 'devlop'
|
||||
import {splice} from 'micromark-util-chunked'
|
||||
import {classifyCharacter} from 'micromark-util-classify-character'
|
||||
import {resolveAll} from 'micromark-util-resolve-all'
|
||||
import {codes, constants, types} from 'micromark-util-symbol'
|
||||
|
||||
/**
|
||||
* 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 = {
|
||||
name: 'strikethrough',
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
24
node_modules/micromark-extension-gfm-strikethrough/index.d.ts
generated
vendored
Normal file
24
node_modules/micromark-extension-gfm-strikethrough/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
export {gfmStrikethroughHtml} from './lib/html.js'
|
||||
export {gfmStrikethrough} from './lib/syntax.js'
|
||||
|
||||
/**
|
||||
* Configuration (optional).
|
||||
*/
|
||||
export interface Options {
|
||||
/**
|
||||
* Whether to support strikethrough with a single tilde (default: `true`).
|
||||
*
|
||||
* Single tildes work on github.com, but are technically prohibited by the
|
||||
* GFM spec.
|
||||
*/
|
||||
singleTilde?: boolean | null | undefined
|
||||
}
|
||||
|
||||
declare module 'micromark-util-types' {
|
||||
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';
|
13
node_modules/micromark-extension-gfm-strikethrough/lib/html.d.ts
generated
vendored
Normal file
13
node_modules/micromark-extension-gfm-strikethrough/lib/html.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @import {HtmlExtension} from 'micromark-util-types'
|
||||
*/
|
||||
/**
|
||||
* Create an HTML extension for `micromark` to support GFM strikethrough when
|
||||
* serializing to HTML.
|
||||
*
|
||||
* @returns {HtmlExtension}
|
||||
* Extension for `micromark` that can be passed in `htmlExtensions`, to
|
||||
* support GFM strikethrough when serializing to HTML.
|
||||
*/
|
||||
export function gfmStrikethroughHtml(): HtmlExtension;
|
||||
import type { HtmlExtension } from 'micromark-util-types';
|
26
node_modules/micromark-extension-gfm-strikethrough/lib/html.js
generated
vendored
Normal file
26
node_modules/micromark-extension-gfm-strikethrough/lib/html.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @import {HtmlExtension} from 'micromark-util-types'
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create an HTML extension for `micromark` to support GFM strikethrough when
|
||||
* serializing to HTML.
|
||||
*
|
||||
* @returns {HtmlExtension}
|
||||
* Extension for `micromark` that can be passed in `htmlExtensions`, to
|
||||
* support GFM strikethrough when serializing to HTML.
|
||||
*/
|
||||
export function gfmStrikethroughHtml() {
|
||||
return {
|
||||
enter: {
|
||||
strikethrough() {
|
||||
this.tag('<del>');
|
||||
}
|
||||
},
|
||||
exit: {
|
||||
strikethrough() {
|
||||
this.tag('</del>');
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
12
node_modules/micromark-extension-gfm-strikethrough/lib/syntax.d.ts
generated
vendored
Normal file
12
node_modules/micromark-extension-gfm-strikethrough/lib/syntax.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 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;
|
||||
import type { Options } from 'micromark-extension-gfm-strikethrough';
|
||||
import type { Extension } from 'micromark-util-types';
|
142
node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
generated
vendored
Normal file
142
node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
generated
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* @import {Options} from 'micromark-extension-gfm-strikethrough'
|
||||
* @import {Event, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
|
||||
*/
|
||||
|
||||
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 = {
|
||||
name: 'strikethrough',
|
||||
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.
|
129
node_modules/micromark-extension-gfm-strikethrough/package.json
generated
vendored
Normal file
129
node_modules/micromark-extension-gfm-strikethrough/package.json
generated
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
{
|
||||
"name": "micromark-extension-gfm-strikethrough",
|
||||
"version": "2.1.0",
|
||||
"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",
|
||||
"files": [
|
||||
"dev/",
|
||||
"lib/",
|
||||
"index.d.ts",
|
||||
"index.js"
|
||||
],
|
||||
"exports": {
|
||||
"development": "./dev/index.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"devlop": "^1.0.0",
|
||||
"micromark-util-chunked": "^2.0.0",
|
||||
"micromark-util-classify-character": "^2.0.0",
|
||||
"micromark-util-resolve-all": "^2.0.0",
|
||||
"micromark-util-symbol": "^2.0.0",
|
||||
"micromark-util-types": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.0.0",
|
||||
"c8": "^10.0.0",
|
||||
"create-gfm-fixtures": "^1.0.0",
|
||||
"micromark": "^4.0.0",
|
||||
"micromark-build": "^2.0.0",
|
||||
"prettier": "^3.0.0",
|
||||
"remark-cli": "^12.0.0",
|
||||
"remark-preset-wooorm": "^10.0.0",
|
||||
"tape": "^5.0.0",
|
||||
"type-coverage": "^2.0.0",
|
||||
"typescript": "^5.0.0",
|
||||
"xo": "^0.58.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepack": "npm run build && npm run format",
|
||||
"build": "tsc --build --clean && tsc --build && type-coverage && micromark-build",
|
||||
"format": "remark . -qfo && prettier . -w --log-level 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": {
|
||||
"bracketSpacing": false,
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "none",
|
||||
"useTabs": false
|
||||
},
|
||||
"remarkConfig": {
|
||||
"plugins": [
|
||||
"remark-preset-wooorm"
|
||||
]
|
||||
},
|
||||
"typeCoverage": {
|
||||
"atLeast": 100,
|
||||
"detail": true,
|
||||
"ignoreCatch": true,
|
||||
"strict": true
|
||||
},
|
||||
"xo": {
|
||||
"prettier": true,
|
||||
"rules": {
|
||||
"logical-assignment-operators": "off",
|
||||
"max-depth": "off",
|
||||
"unicorn/prefer-at": "off"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": "**/*.ts",
|
||||
"rules": {
|
||||
"@typescript-eslint/array-type": [
|
||||
"error",
|
||||
{
|
||||
"default": "generic"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/ban-types": [
|
||||
"error",
|
||||
{
|
||||
"extendDefaults": true
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/consistent-type-definitions": [
|
||||
"error",
|
||||
"interface"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "test/**/*.js",
|
||||
"rules": {
|
||||
"no-await-in-loop": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
304
node_modules/micromark-extension-gfm-strikethrough/readme.md
generated
vendored
Normal file
304
node_modules/micromark-extension-gfm-strikethrough/readme.md
generated
vendored
Normal file
@@ -0,0 +1,304 @@
|
||||
# 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 16+), 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@2'
|
||||
```
|
||||
|
||||
In browsers with [`esm.sh`][esmsh]:
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import {gfmStrikethrough, gfmStrikethroughHtml} from 'https://esm.sh/micromark-extension-gfm-strikethrough@2?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()`
|
||||
|
||||
Create an HTML extension for `micromark` to support GFM strikethrough when
|
||||
serializing to HTML.
|
||||
|
||||
###### Returns
|
||||
|
||||
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 maintained
|
||||
versions of Node.js.
|
||||
|
||||
When we cut a new major release, we drop support for unmaintained versions of
|
||||
Node.
|
||||
This means we try to keep the current release line,
|
||||
`micromark-extension-gfm-strikethrough@^2`, compatible with Node.js 16.
|
||||
|
||||
This package works with `micromark` version `3` and later.
|
||||
|
||||
## 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/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm-strikethrough
|
||||
|
||||
[size]: https://bundlejs.com/?q=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
|
Reference in New Issue
Block a user