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:
53
node_modules/rehype-parse/lib/index.d.ts
generated
vendored
Normal file
53
node_modules/rehype-parse/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* Plugin to add support for parsing from HTML.
|
||||
*
|
||||
* > 👉 **Note**: this is not an XML parser.
|
||||
* > It supports SVG as embedded in HTML.
|
||||
* > It does not support the features available in XML.
|
||||
* > Passing SVG files might break but fragments of modern SVG should be fine.
|
||||
* > Use [`xast-util-from-xml`][xast-util-from-xml] to parse XML.
|
||||
*
|
||||
* @param {Options | null | undefined} [options]
|
||||
* Configuration (optional).
|
||||
* @returns {undefined}
|
||||
* Nothing.
|
||||
*/
|
||||
export default function rehypeParse(options?: Options | null | undefined): undefined;
|
||||
export default class rehypeParse {
|
||||
/**
|
||||
* Plugin to add support for parsing from HTML.
|
||||
*
|
||||
* > 👉 **Note**: this is not an XML parser.
|
||||
* > It supports SVG as embedded in HTML.
|
||||
* > It does not support the features available in XML.
|
||||
* > Passing SVG files might break but fragments of modern SVG should be fine.
|
||||
* > Use [`xast-util-from-xml`][xast-util-from-xml] to parse XML.
|
||||
*
|
||||
* @param {Options | null | undefined} [options]
|
||||
* Configuration (optional).
|
||||
* @returns {undefined}
|
||||
* Nothing.
|
||||
*/
|
||||
constructor(options?: Options | null | undefined);
|
||||
parser: (document: string, file: import("vfile").VFile) => Root;
|
||||
}
|
||||
/**
|
||||
* Configuration.
|
||||
*/
|
||||
export type Options = Omit<FromHtmlOptions, "onerror"> & RehypeParseFields;
|
||||
/**
|
||||
* Extra fields.
|
||||
*/
|
||||
export type RehypeParseFields = {
|
||||
/**
|
||||
* Whether to emit parse errors while parsing (default: `false`).
|
||||
*
|
||||
* > 👉 **Note**: parse errors are currently being added to HTML.
|
||||
* > Not all errors emitted by parse5 (or us) are specced yet.
|
||||
* > Some documentation may still be missing.
|
||||
*/
|
||||
emitParseErrors?: boolean | null | undefined;
|
||||
};
|
||||
import type { Root } from 'hast';
|
||||
import type { Options as FromHtmlOptions } from 'hast-util-from-html';
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
node_modules/rehype-parse/lib/index.d.ts.map
generated
vendored
Normal file
1
node_modules/rehype-parse/lib/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;GAaG;AACH,8CALW,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,SAAS,CA6BrB;;IAxCD;;;;;;;;;;;;;OAaG;IACH,sBALW,OAAO,GAAG,IAAI,GAAG,SAAS,EA+BpC;IApBC,gEAAoB;;;;;sBAnCT,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,GAAG,iBAAiB;;;;;;;;;;;;sBAKnD,OAAO,GAAG,IAAI,GAAG,SAAS;;0BAXjB,MAAM;gDACgB,qBAAqB"}
|
63
node_modules/rehype-parse/lib/index.js
generated
vendored
Normal file
63
node_modules/rehype-parse/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @import {Root} from 'hast'
|
||||
* @import {Options as FromHtmlOptions} from 'hast-util-from-html'
|
||||
* @import {Parser, Processor} from 'unified'
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Omit<FromHtmlOptions, 'onerror'> & RehypeParseFields} Options
|
||||
* Configuration.
|
||||
*
|
||||
* @typedef RehypeParseFields
|
||||
* Extra fields.
|
||||
* @property {boolean | null | undefined} [emitParseErrors=false]
|
||||
* Whether to emit parse errors while parsing (default: `false`).
|
||||
*
|
||||
* > 👉 **Note**: parse errors are currently being added to HTML.
|
||||
* > Not all errors emitted by parse5 (or us) are specced yet.
|
||||
* > Some documentation may still be missing.
|
||||
*/
|
||||
|
||||
import {fromHtml} from 'hast-util-from-html'
|
||||
|
||||
/**
|
||||
* Plugin to add support for parsing from HTML.
|
||||
*
|
||||
* > 👉 **Note**: this is not an XML parser.
|
||||
* > It supports SVG as embedded in HTML.
|
||||
* > It does not support the features available in XML.
|
||||
* > Passing SVG files might break but fragments of modern SVG should be fine.
|
||||
* > Use [`xast-util-from-xml`][xast-util-from-xml] to parse XML.
|
||||
*
|
||||
* @param {Options | null | undefined} [options]
|
||||
* Configuration (optional).
|
||||
* @returns {undefined}
|
||||
* Nothing.
|
||||
*/
|
||||
export default function rehypeParse(options) {
|
||||
/** @type {Processor<Root>} */
|
||||
// @ts-expect-error: TS in JSDoc generates wrong types if `this` is typed regularly.
|
||||
const self = this
|
||||
const {emitParseErrors, ...settings} = {...self.data('settings'), ...options}
|
||||
|
||||
self.parser = parser
|
||||
|
||||
/**
|
||||
* @type {Parser<Root>}
|
||||
*/
|
||||
function parser(document, file) {
|
||||
return fromHtml(document, {
|
||||
...settings,
|
||||
onerror: emitParseErrors
|
||||
? function (message) {
|
||||
if (file.path) {
|
||||
message.name = file.path + ':' + message.name
|
||||
message.file = file.path
|
||||
}
|
||||
|
||||
file.messages.push(message)
|
||||
}
|
||||
: undefined
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user