char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aleksander Grygierui: Refactor data-attrs constants, enum for bool strings (#27002)bdffafa5d

char/aliceai-t5-moe
828 B23 linesraw
1export const IMAGE_NOT_ERROR_BOUND_SELECTOR = 'img:not([data-error-bound])';
2
3/** Data attributes for the markdown renderer DOM contract. */
4export const MARKDOWN_DATA_ATTRS = {
5	BLOCK_ID: 'data-block-id',
6	CODE_ID: 'data-code-id',
7	ERROR_BOUND: 'data-error-bound',
8	ERROR_HANDLED: 'data-error-handled',
9	LISTENER_BOUND: 'data-listener-bound',
10	ORIGINAL_SRC: 'data-original-src'
11} as const;
12
13/** Markdown structural markers used by `looksLikeMarkdown`. Inline / line-level. */
14export const MARKDOWN = {
15	ATX_HEADING_REGEX: /^#{1,6}\s+\S/,
16	BLOCKQUOTE_REGEX: /^>\s+\S/,
17	BOLD_REGEX: /\*\*[^*\n]+\*\*|__[^_\n]+__/,
18	CODE_FENCE_REGEX: /^(```|~~~)/m,
19	LINK_REGEX: /\[[^\]\n]+\]\([^)\s]+\)/,
20	LIST_BULLET_REGEX: /^\s*[-*+]\s+\S/,
21	LIST_NUMBERED_REGEX: /^\s*\d+[.)]\s+\S/,
22	TABLE_SEPARATOR_REGEX: /^\s*\|?[\s:|-]+\|?\s*$/
23} as const;