Skip to content

Commit 44ca166

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

File tree

4 files changed

+3
-161
lines changed

4 files changed

+3
-161
lines changed

src/library/GithubPermalink/GithubPermalinkBase.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export function GithubPermalinkBase(props: GithubPermalinkBaseProps) {
2727
if (data.status === "ok") {
2828

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

3231
const clipboard = formatedLineExclusions.reduce((acc, cur) => {
3332
if (cur.isExclude) {
@@ -43,11 +42,11 @@ export function GithubPermalinkBase(props: GithubPermalinkBaseProps) {
4342

4443
{formatedLineExclusions.map((v) => {
4544
if (v.isExclude) {
46-
return <SyntaxHighlight className="hide-line-numbers" text={excludeText} startingLineNumber={v.from} language={language} key={v.from}/>
45+
return <SyntaxHighlight className="hide-line-numbers" text={excludeText} startingLineNumber={v.from} language={language} key={v.from} />
4746

4847
}
4948

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

5251
})}
5352

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)