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:
25
node_modules/mdast-util-to-hast/lib/handlers/text.js
generated
vendored
Normal file
25
node_modules/mdast-util-to-hast/lib/handlers/text.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @typedef {import('hast').Element} HastElement
|
||||
* @typedef {import('hast').Text} HastText
|
||||
* @typedef {import('mdast').Text} MdastText
|
||||
* @typedef {import('../state.js').State} State
|
||||
*/
|
||||
|
||||
import {trimLines} from 'trim-lines'
|
||||
|
||||
/**
|
||||
* Turn an mdast `text` node into hast.
|
||||
*
|
||||
* @param {State} state
|
||||
* Info passed around.
|
||||
* @param {MdastText} node
|
||||
* mdast node.
|
||||
* @returns {HastElement | HastText}
|
||||
* hast node.
|
||||
*/
|
||||
export function text(state, node) {
|
||||
/** @type {HastText} */
|
||||
const result = {type: 'text', value: trimLines(String(node.value))}
|
||||
state.patch(node, result)
|
||||
return state.applyData(node, result)
|
||||
}
|
Reference in New Issue
Block a user