Text display is good now
This commit is contained in:
parent
3fc1ca3591
commit
0be9d3de31
5 changed files with 84 additions and 34 deletions
|
@ -60,7 +60,36 @@ export default function Content({ src }: { src: string}) {
|
|||
return response.text();
|
||||
},
|
||||
postprocess: (data: string) => {
|
||||
set_content(<Text text={data} />);
|
||||
const languages = {
|
||||
// "markup",
|
||||
js: "jsx",
|
||||
mjs: "jsx",
|
||||
jsx: "jsx",
|
||||
// "js-extras",
|
||||
ts: "tsx",
|
||||
tsx: "tsx",
|
||||
swift: "swift",
|
||||
kt: "kotlin",
|
||||
kts: "kotlin",
|
||||
ktm: "kotlin",
|
||||
// "objectivec",
|
||||
// "reason",
|
||||
rs: "rust",
|
||||
// "graphql",
|
||||
yml: "yaml",
|
||||
yaml: "yaml",
|
||||
go: "go",
|
||||
c: "cpp",
|
||||
cpp: "cpp",
|
||||
cxx: "cpp",
|
||||
h: "cpp",
|
||||
hpp: "cpp",
|
||||
hxx: "cpp",
|
||||
py: "python",
|
||||
json: "json",
|
||||
}
|
||||
const split = window.location.pathname.split('.');
|
||||
set_content(<Text language={split.length == 0 ? 'none' : languages[split[split.length - 1]]} text={data} />);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue