Saving all progress

This commit is contained in:
Luke Hagar
2025-03-19 22:47:50 -05:00
parent 5c6e8a1e4f
commit 00593b402b
14988 changed files with 2598505 additions and 1 deletions

33
node_modules/micromark-util-encode/index.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
const characterReferences = {'"': 'quot', '&': 'amp', '<': 'lt', '>': 'gt'}
/**
* Encode only the dangerous HTML characters.
*
* This ensures that certain characters which have special meaning in HTML are
* dealt with.
* Technically, we can skip `>` and `"` in many cases, but CM includes them.
*
* @param {string} value
* Value to encode.
* @returns {string}
* Encoded value.
*/
export function encode(value) {
return value.replace(/["&<>]/g, replace)
/**
* @param {string} value
* Value to replace.
* @returns {string}
* Encoded value.
*/
function replace(value) {
return (
'&' +
characterReferences[
/** @type {keyof typeof characterReferences} */ (value)
] +
';'
)
}
}