Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1/**2 * @typedef {import('hast-util-sanitize').Schema} Schema3 * @typedef {import('hast-util-to-html').Options} ToHtmlOptions4 * @typedef {import('mdast').Root} Root5 * @typedef {import('mdast-util-to-hast').Handlers} Handlers6 * @typedef {import('unified').Compiler<Root, string>} Compiler7 * @typedef {import('unified').Processor<undefined, undefined, undefined, Root, string>} Processor8 */9 10/**11 * @typedef ExtraOptionsFields12 * Extra fields.13 * @property {Readonly<Handlers> | null | undefined} [handlers]14 * How to turn mdast nodes into hast nodes (optional);15 * passed to `mdast-util-to-hast`.16 * @property {Readonly<Schema> | boolean | null | undefined} [sanitize]17 * Sanitize the output, and how (default: `true`).18 *19 * @typedef {ToHtmlOptions & ExtraOptionsFields} Options20 * Configuration.21 */22 23import {sanitize} from 'hast-util-sanitize'24import {toHast} from 'mdast-util-to-hast'25import {toHtml} from 'hast-util-to-html'26 27/** @type {Readonly<Options>} */28const emptyOptions = {}29 30/**31 * Serialize markdown as HTML.32 *33 * ###### Notes34 *35 * Passing `sanitize: false` is dangerous.36 * It allows arbitrary HTML and does not sanitize elements.37 *38 * @param {Readonly<Options> | null | undefined} [options]39 * Configuration (optional).40 * @returns {undefined}41 * Nothing.42 */43export default function remarkHtml(options) {44 /** @type {Processor} */45 // @ts-expect-error: TS in JSDoc generates wrong types if `this` is typed regularly.46 // eslint-disable-next-line unicorn/no-this-assignment47 const self = this48 const {handlers, sanitize: clean, ...toHtmlOptions} = options || emptyOptions49 let allowDangerousHtml = false50 /** @type {Readonly<Schema> | undefined} */51 let schema52 53 if (typeof clean === 'boolean') {54 allowDangerousHtml = !clean55 } else if (clean) {56 schema = clean57 }58 59 self.compiler = compiler60 61 /**62 * @type {Compiler}63 */64 function compiler(tree, file) {65 const hast = toHast(tree, {handlers, allowDangerousHtml})66 const safeHast = allowDangerousHtml ? hast : sanitize(hast, schema)67 const result = toHtml(safeHast, {...toHtmlOptions, allowDangerousHtml})68 69 if (file.extname) {70 file.extname = '.html'71 }72 73 // Add an eof eol.74 return tree &&75 tree.type === 'root' &&76 result &&77 /[^\r\n]/.test(result.charAt(result.length - 1))78 ? result + '\n'79 : result80 }81}82 