|
|
|
@ -27,49 +27,93 @@ var ( |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Extensions that are same as highlight classes.
|
|
|
|
|
// See hljs.listLanguages() for list of language names.
|
|
|
|
|
highlightExts = map[string]struct{}{ |
|
|
|
|
".applescript": {}, |
|
|
|
|
".arm": {}, |
|
|
|
|
".as": {}, |
|
|
|
|
".sh": {}, |
|
|
|
|
".cs": {}, |
|
|
|
|
".cpp": {}, |
|
|
|
|
".bash": {}, |
|
|
|
|
".bat": {}, |
|
|
|
|
".c": {}, |
|
|
|
|
".css": {}, |
|
|
|
|
".cmake": {}, |
|
|
|
|
".bat": {}, |
|
|
|
|
".cpp": {}, |
|
|
|
|
".cs": {}, |
|
|
|
|
".css": {}, |
|
|
|
|
".dart": {}, |
|
|
|
|
".patch": {}, |
|
|
|
|
".erl": {}, |
|
|
|
|
".diff": {}, |
|
|
|
|
".django": {}, |
|
|
|
|
".go": {}, |
|
|
|
|
".gradle": {}, |
|
|
|
|
".groovy": {}, |
|
|
|
|
".haml": {}, |
|
|
|
|
".handlebars": {}, |
|
|
|
|
".html": {}, |
|
|
|
|
".xml": {}, |
|
|
|
|
".hs": {}, |
|
|
|
|
".ini": {}, |
|
|
|
|
".json": {}, |
|
|
|
|
".java": {}, |
|
|
|
|
".js": {}, |
|
|
|
|
".json": {}, |
|
|
|
|
".less": {}, |
|
|
|
|
".lua": {}, |
|
|
|
|
".php": {}, |
|
|
|
|
".py": {}, |
|
|
|
|
".rb": {}, |
|
|
|
|
".rs": {}, |
|
|
|
|
".scala": {}, |
|
|
|
|
".scss": {}, |
|
|
|
|
".sql": {}, |
|
|
|
|
".scala": {}, |
|
|
|
|
".swift": {}, |
|
|
|
|
".ts": {}, |
|
|
|
|
".vb": {}, |
|
|
|
|
".yml": {}, |
|
|
|
|
".xml": {}, |
|
|
|
|
".yaml": {}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Extensions that are not same as highlight classes.
|
|
|
|
|
highlightMapping = map[string]string{ |
|
|
|
|
".txt": "nohighlight", |
|
|
|
|
".ahk": "autohotkey", |
|
|
|
|
".crmsh": "crmsh", |
|
|
|
|
".dash": "shell", |
|
|
|
|
".erl": "erlang", |
|
|
|
|
".escript": "erlang", |
|
|
|
|
".ex": "elixir", |
|
|
|
|
".exs": "elixir", |
|
|
|
|
".f": "fortran", |
|
|
|
|
".f77": "fortran", |
|
|
|
|
".f90": "fortran", |
|
|
|
|
".f95": "fortran", |
|
|
|
|
".feature": "gherkin", |
|
|
|
|
".fish": "shell", |
|
|
|
|
".for": "fortran", |
|
|
|
|
".hbs": "handlebars", |
|
|
|
|
".hs": "haskell", |
|
|
|
|
".hx": "haxe", |
|
|
|
|
".js": "javascript", |
|
|
|
|
".jsx": "javascript", |
|
|
|
|
".ksh": "shell", |
|
|
|
|
".kt": "kotlin", |
|
|
|
|
".l": "ocaml", |
|
|
|
|
".ls": "livescript", |
|
|
|
|
".md": "markdown", |
|
|
|
|
".mjs": "javascript", |
|
|
|
|
".mli": "ocaml", |
|
|
|
|
".mll": "ocaml", |
|
|
|
|
".mly": "ocaml", |
|
|
|
|
".patch": "diff", |
|
|
|
|
".pl": "perl", |
|
|
|
|
".pm": "perl", |
|
|
|
|
".ps1": "powershell", |
|
|
|
|
".psd1": "powershell", |
|
|
|
|
".psm1": "powershell", |
|
|
|
|
".py": "python", |
|
|
|
|
".pyw": "python", |
|
|
|
|
".rb": "ruby", |
|
|
|
|
".rs": "rust", |
|
|
|
|
".scpt": "applescript", |
|
|
|
|
".scptd": "applescript", |
|
|
|
|
".sh": "bash", |
|
|
|
|
".tcsh": "shell", |
|
|
|
|
".ts": "typescript", |
|
|
|
|
".tsx": "typescript", |
|
|
|
|
".txt": "plaintext", |
|
|
|
|
".vb": "vbnet", |
|
|
|
|
".vbs": "vbscript", |
|
|
|
|
".yml": "yaml", |
|
|
|
|
".zsh": "shell", |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|