adds markdown support, fix code wrapping

This commit is contained in:
Daniel Avila 2023-02-24 11:24:09 -05:00
parent c58a9bbe93
commit fd01fd3334
9 changed files with 1545 additions and 115 deletions

View file

@ -3,4 +3,42 @@ import { twMerge } from 'tailwind-merge';
export function cn(...inputs) {
return twMerge(clsx(inputs));
}
}
export const languages = [
'java',
'c',
'markdown',
'css',
'html',
'xml',
'bash',
'json',
'yaml',
'jsx',
'python',
'c++',
'javascript',
'csharp',
'php',
'typescript',
'swift',
'objectivec',
'sql',
'r',
'kotlin',
'ruby',
'go',
'x86asm',
'matlab',
'perl',
'pascal'
];
export const wrapperRegex = {
codeRegex: /(```[\s\S]*?```)/g,
inLineRegex: /(`[^`]+?`)/g,
matchRegex: /(`[^`]+?`)/g,
languageMatch: /^```(\w+)/,
newLineMatch: /^```(\n+)/
};