Update HighlightJS and fix YAML files highlighting (#1764)

* Update HighlightJS to 9.11.0

* Fix YAML files highlighting
pull/1759/merge
Andrey Nering 8 years ago committed by Lunny Xiao
parent 80cea8747f
commit be5323a05f
  1. 70
      modules/highlight/highlight.go
  2. 0
      public/plugins/highlight-9.11.0/default.css
  3. 0
      public/plugins/highlight-9.11.0/github.css
  4. 3
      public/plugins/highlight-9.11.0/highlight.pack.js
  5. 3
      public/plugins/highlight-9.6.0/highlight.pack.js
  6. 2
      templates/base/footer.tmpl
  7. 2
      templates/base/head.tmpl

@ -25,39 +25,41 @@ var (
}
// Extensions that are same as highlight classes.
highlightExts = map[string]bool{
".arm": true,
".as": true,
".sh": true,
".cs": true,
".cpp": true,
".c": true,
".css": true,
".cmake": true,
".bat": true,
".dart": true,
".patch": true,
".elixir": true,
".erlang": true,
".go": true,
".html": true,
".xml": true,
".hs": true,
".ini": true,
".json": true,
".java": true,
".js": true,
".less": true,
".lua": true,
".php": true,
".py": true,
".rb": true,
".scss": true,
".sql": true,
".scala": true,
".swift": true,
".ts": true,
".vb": true,
highlightExts = map[string]struct{}{
".arm": {},
".as": {},
".sh": {},
".cs": {},
".cpp": {},
".c": {},
".css": {},
".cmake": {},
".bat": {},
".dart": {},
".patch": {},
".elixir": {},
".erlang": {},
".go": {},
".html": {},
".xml": {},
".hs": {},
".ini": {},
".json": {},
".java": {},
".js": {},
".less": {},
".lua": {},
".php": {},
".py": {},
".rb": {},
".scss": {},
".sql": {},
".scala": {},
".swift": {},
".ts": {},
".vb": {},
".yml": {},
".yaml": {},
}
// Extensions that are not same as highlight classes.
@ -85,7 +87,7 @@ func FileNameToHighlightClass(fname string) string {
}
ext := path.Ext(fname)
if highlightExts[ext] {
if _, ok := highlightExts[ext]; ok {
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 -->
{{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}}
{{if .RequireMinicolors}}
<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}}">
{{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}}
{{if .RequireMinicolors}}
<link rel="stylesheet" href="{{AppSubUrl}}/plugins/jquery.minicolors-2.2.3/jquery.minicolors.css">

Loading…
Cancel
Save