Update HighlightJS and fix YAML files highlighting (#1764)
* Update HighlightJS to 9.11.0 * Fix YAML files highlighting
This commit is contained in:
parent
80cea8747f
commit
be5323a05f
|
@ -25,39 +25,41 @@ var (
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extensions that are same as highlight classes.
|
// Extensions that are same as highlight classes.
|
||||||
highlightExts = map[string]bool{
|
highlightExts = map[string]struct{}{
|
||||||
".arm": true,
|
".arm": {},
|
||||||
".as": true,
|
".as": {},
|
||||||
".sh": true,
|
".sh": {},
|
||||||
".cs": true,
|
".cs": {},
|
||||||
".cpp": true,
|
".cpp": {},
|
||||||
".c": true,
|
".c": {},
|
||||||
".css": true,
|
".css": {},
|
||||||
".cmake": true,
|
".cmake": {},
|
||||||
".bat": true,
|
".bat": {},
|
||||||
".dart": true,
|
".dart": {},
|
||||||
".patch": true,
|
".patch": {},
|
||||||
".elixir": true,
|
".elixir": {},
|
||||||
".erlang": true,
|
".erlang": {},
|
||||||
".go": true,
|
".go": {},
|
||||||
".html": true,
|
".html": {},
|
||||||
".xml": true,
|
".xml": {},
|
||||||
".hs": true,
|
".hs": {},
|
||||||
".ini": true,
|
".ini": {},
|
||||||
".json": true,
|
".json": {},
|
||||||
".java": true,
|
".java": {},
|
||||||
".js": true,
|
".js": {},
|
||||||
".less": true,
|
".less": {},
|
||||||
".lua": true,
|
".lua": {},
|
||||||
".php": true,
|
".php": {},
|
||||||
".py": true,
|
".py": {},
|
||||||
".rb": true,
|
".rb": {},
|
||||||
".scss": true,
|
".scss": {},
|
||||||
".sql": true,
|
".sql": {},
|
||||||
".scala": true,
|
".scala": {},
|
||||||
".swift": true,
|
".swift": {},
|
||||||
".ts": true,
|
".ts": {},
|
||||||
".vb": true,
|
".vb": {},
|
||||||
|
".yml": {},
|
||||||
|
".yaml": {},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extensions that are not same as highlight classes.
|
// Extensions that are not same as highlight classes.
|
||||||
|
@ -85,7 +87,7 @@ func FileNameToHighlightClass(fname string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
ext := path.Ext(fname)
|
ext := path.Ext(fname)
|
||||||
if highlightExts[ext] {
|
if _, ok := highlightExts[ext]; ok {
|
||||||
return ext[1:]
|
return ext[1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
<!-- Third-party libraries -->
|
<!-- Third-party libraries -->
|
||||||
{{if .RequireHighlightJS}}
|
{{if .RequireHighlightJS}}
|
||||||
<script src="{{AppSubUrl}}/plugins/highlight-9.6.0/highlight.pack.js"></script>
|
<script src="{{AppSubUrl}}/plugins/highlight-9.11.0/highlight.pack.js"></script>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .RequireMinicolors}}
|
{{if .RequireMinicolors}}
|
||||||
<script src="{{AppSubUrl}}/plugins/jquery.minicolors-2.2.3/jquery.minicolors.min.js"></script>
|
<script src="{{AppSubUrl}}/plugins/jquery.minicolors-2.2.3/jquery.minicolors.min.js"></script>
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<link rel="stylesheet" href="{{AppSubUrl}}/css/index.css?v={{MD5 AppVer}}">
|
<link rel="stylesheet" href="{{AppSubUrl}}/css/index.css?v={{MD5 AppVer}}">
|
||||||
|
|
||||||
{{if .RequireHighlightJS}}
|
{{if .RequireHighlightJS}}
|
||||||
<link rel="stylesheet" href="{{AppSubUrl}}/plugins/highlight-9.6.0/github.css">
|
<link rel="stylesheet" href="{{AppSubUrl}}/plugins/highlight-9.11.0/github.css">
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .RequireMinicolors}}
|
{{if .RequireMinicolors}}
|
||||||
<link rel="stylesheet" href="{{AppSubUrl}}/plugins/jquery.minicolors-2.2.3/jquery.minicolors.css">
|
<link rel="stylesheet" href="{{AppSubUrl}}/plugins/jquery.minicolors-2.2.3/jquery.minicolors.css">
|
||||||
|
|
Loading…
Reference in New Issue