Skip to content

Commit aa559dc

Browse files
committed
Get rid of 'getLanguageFromPath' stuff
1 parent 286cac6 commit aa559dc

File tree

4 files changed

+3
-162
lines changed

4 files changed

+3
-162
lines changed

src/library/GithubPermalink/GithubPermalinkBase.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { SyntaxHighlight } from "../SyntaxHighlight/SyntaxHighlight";
66
import { formatForLineExclusions } from "./formatLineExclusions";
77
import { CopySvg } from "../images/CopySvg";
88
import { CopyButton } from "../common/CopyButton/CopyButton";
9-
import { getLanguageFromPath } from "../utils/getLanguageFromPath";
109

1110
export type GithubPermalinkBaseProps = {
1211
className?: string;
@@ -27,7 +26,6 @@ export function GithubPermalinkBase(props: GithubPermalinkBaseProps) {
2726
if (data.status === "ok") {
2827

2928
const formatedLineExclusions = formatForLineExclusions(data, excludeLines);
30-
const language = getLanguageFromPath(data.path);
3129

3230
const clipboard = formatedLineExclusions.reduce((acc, cur) => {
3331
if (cur.isExclude) {
@@ -43,11 +41,11 @@ export function GithubPermalinkBase(props: GithubPermalinkBaseProps) {
4341

4442
{formatedLineExclusions.map((v) => {
4543
if (v.isExclude) {
46-
return <SyntaxHighlight className="hide-line-numbers" text={excludeText} startingLineNumber={v.from} language={language} key={v.from}/>
44+
return <SyntaxHighlight className="hide-line-numbers" text={excludeText} startingLineNumber={v.from} key={v.from} />
4745

4846
}
4947

50-
return <SyntaxHighlight text={v.lines.join("\n")} startingLineNumber={v.from} language={language} key={v.from}/>
48+
return <SyntaxHighlight text={v.lines.join("\n")} startingLineNumber={v.from} key={v.from} />
5149

5250
})}
5351

src/library/SyntaxHighlight/SyntaxHighlight.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function SyntaxHighlight(props: {
129129
language?: string;
130130
}) {
131131

132-
const { startingLineNumber, text, className, language = "javascript" } = props;
132+
const { startingLineNumber, text, className } = props;
133133

134134
const isDarkMode = useMediaQuery({ query: "(prefers-color-scheme: dark)" })
135135

src/library/utils/getLanguageFromPath.test.ts

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/library/utils/getLanguageFromPath.ts

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)