diff --git a/src/app/[...file]/components/types/text.css.ts b/src/app/[...file]/components/types/text.css.ts index ccfee53..a414766 100644 --- a/src/app/[...file]/components/types/text.css.ts +++ b/src/app/[...file]/components/types/text.css.ts @@ -21,9 +21,12 @@ export const group = style({ export const line_numbers = style({ margin: '0', - marginRight: '0.5em', - paddingRight: '0.5em', + marginRight: '1em', color: colors.foreground2, textAlign: 'right', userSelect: 'none', }); + +export const plain = style({ + margin: 0, +}); diff --git a/src/app/[...file]/components/types/text.tsx b/src/app/[...file]/components/types/text.tsx index 0755cb6..cf50a2c 100644 --- a/src/app/[...file]/components/types/text.tsx +++ b/src/app/[...file]/components/types/text.tsx @@ -38,7 +38,6 @@ const type_map = { json: 'json', md: 'markdown', markdown: 'markdown', - none: 'none', } export function map_to_type(extension?: string) { @@ -68,24 +67,28 @@ export default function Text({ language, text, line_numbers }: { language: strin }; }); + console.log(language, language in type_map); return
{line_numbers ?

{lines.map((_, index) => `${index}\n`)}

: <>} - - {({ tokens, getLineProps, getTokenProps }) => ( -
- {tokens.map((line, i) => ( -
- {line.map((token, key) => ( - - ))} -
- ))} -
- )} -
+ {language in type_map ? + + {({ tokens, getLineProps, getTokenProps }) => ( +
+ {tokens.map((line, i) => ( +
+ {line.map((token, key) => ( + + ))} +
+ ))} +
+ )} +
: +

{text}

+ }
; }