mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-05-02 17:07:13 +00:00
Fix markdown issue where type is missing in backticks (#2719)
This commit is contained in:
parent
b2c18ba41e
commit
c9d49a5f32
1 changed files with 6 additions and 5 deletions
|
@ -11,12 +11,13 @@ const markdown = markdownIt({
|
|||
typographer: true,
|
||||
highlight: function (code, lang) {
|
||||
const uuid = v4();
|
||||
const theme =
|
||||
window.localStorage.getItem("theme") === "light"
|
||||
? "github"
|
||||
: "github-dark";
|
||||
|
||||
if (lang && hljs.getLanguage(lang)) {
|
||||
try {
|
||||
const theme =
|
||||
window.localStorage.getItem("theme") === "light"
|
||||
? "github"
|
||||
: "github-dark";
|
||||
return (
|
||||
`<div class="whitespace-pre-line w-full hljs ${theme} light:border light:border-gray-700 rounded-lg px-4 pb-4 relative font-mono font-normal text-sm text-slate-200">
|
||||
<div class="w-full flex items-center absolute top-0 left-0 text-slate-200 light:bg-sky-800 bg-stone-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md">
|
||||
|
@ -36,7 +37,7 @@ const markdown = markdownIt({
|
|||
}
|
||||
|
||||
return (
|
||||
`<div class="whitespace-pre-line w-full rounded-lg bg-black-900 light:bg-gray-200 px-4 pb-4 relative font-mono font-normal text-sm text-slate-200">
|
||||
`<div class="whitespace-pre-line w-full hljs ${theme} light:border light:border-gray-700 rounded-lg px-4 pb-4 relative font-mono font-normal text-sm text-slate-200">
|
||||
<div class="w-full flex items-center absolute top-0 left-0 text-slate-200 bg-stone-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md">
|
||||
<div class="flex gap-2"><code class="text-xs"></code></div>
|
||||
<button data-code-snippet data-code="code-${uuid}" class="flex items-center gap-x-2">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue