Skip to content
Snippets Groups Projects
Unverified Commit c9d49a5f authored by Timothy Carambat's avatar Timothy Carambat Committed by GitHub
Browse files

Fix markdown issue where type is missing in backticks (#2719)

parent b2c18ba4
No related branches found
No related tags found
No related merge requests found
......@@ -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">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment