fix: 🐛 Fix marked import

This commit is contained in:
ThatOneCalculator 2022-03-23 11:34:44 -07:00
parent 1ffb3abdfd
commit 4ed5065bef
1 changed files with 2 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import "no-darkreader"
import hljs from "highlight.js"
import marked from "marked"
import { marked } from "marked"
import JSConfetti from "js-confetti"
import Scrollbar from "smooth-scrollbar"
@ -130,8 +130,7 @@ function viewPaste(content: string, views: string) {
for (let i = 1; i <= content.split("\n").length; i++) {
lineNumbers.innerHTML = lineNumbers.innerHTML + `${i}<br>`
}
if (content.substring(0, 3) == "---") {
console.log(marked.parse(content))
if (content.startsWith("---")) {
codeView.innerHTML = marked.parse(content)
} else {
codeView.innerHTML = hljs.highlightAuto(content).value