Skip to content

Commit 10e8791

Browse files
author
ACR1209
committed
Patch syntax highlighting for frameworks
1 parent a1628b2 commit 10e8791

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

cspell-dict.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
quicksnip
22
slugifyed
3-
sublanguage
3+
sublanguage
4+
fastapi

src/components/SnippetList.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import { SnippetType } from "@types";
88
import { LeftAngleArrowIcon } from "./Icons";
99
import SnippetModal from "./SnippetModal";
1010

11+
const extensions: { [key: string]: string } = {
12+
REACT: "tsx",
13+
FASTAPI: "py",
14+
};
15+
1116
const SnippetList = () => {
1217
const { language, snippet, setSnippet } = useAppContext();
1318
const { fetchedSnippets } = useSnippets();
@@ -87,7 +92,7 @@ const SnippetList = () => {
8792
<SnippetModal
8893
snippet={snippet}
8994
handleCloseModal={handleCloseModal}
90-
language={language.name}
95+
language={extensions[language.name] || language.name}
9196
/>
9297
)}
9398
</AnimatePresence>

0 commit comments

Comments
 (0)