Compare commits

..

No commits in common. "mia" and "v1.0.0" have entirely different histories.
mia ... v1.0.0

2 changed files with 20 additions and 26 deletions

View file

@ -21,12 +21,9 @@ export const group = style({
export const line_numbers = style({ export const line_numbers = style({
margin: '0', margin: '0',
marginRight: '1em', marginRight: '0.5em',
paddingRight: '0.5em',
color: colors.foreground2, color: colors.foreground2,
textAlign: 'right', textAlign: 'right',
userSelect: 'none', userSelect: 'none',
}); });
export const plain = style({
margin: 0,
});

View file

@ -38,6 +38,7 @@ const type_map = {
json: 'json', json: 'json',
md: 'markdown', md: 'markdown',
markdown: 'markdown', markdown: 'markdown',
none: 'none',
} }
export function map_to_type(extension?: string) { export function map_to_type(extension?: string) {
@ -67,10 +68,8 @@ export default function Text({ language, text, line_numbers }: { language: strin
}; };
}); });
console.log(language, language in type_map);
return <div className={style.group}> return <div className={style.group}>
{line_numbers ? <p className={style.line_numbers}>{lines.map((_, index) => `${index}\n`)}</p> : <></>} {line_numbers ? <p className={style.line_numbers}>{lines.map((_, index) => `${index}\n`)}</p> : <></>}
{language in type_map ?
<Highlight <Highlight
theme={themes[light_theme ? 'nightOwlLight' : 'oneDark']} theme={themes[light_theme ? 'nightOwlLight' : 'oneDark']}
code={text} code={text}
@ -87,8 +86,6 @@ export default function Text({ language, text, line_numbers }: { language: strin
))} ))}
</div> </div>
)} )}
</Highlight> : </Highlight>
<p className={style.plain}>{text}</p>
}
</div>; </div>;
} }