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. // 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…
Cancel
Save