Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Bug 1520004: Update Prism to version 1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Jan 17, 2019
1 parent 3b61ee8 commit d68ee9c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"dependencies": {
"html5shiv": "3.6.2",
"jquery": "2.2.0",
"prism": "1.2.0",
"prism": "1.15.0",
"selectivizr": "https://github.com/keithclark/selectivizr.git#1.0.2"
},
"install": {
Expand All @@ -19,6 +19,7 @@
"bower_components/prism/components/prism-css.js",
"bower_components/prism/components/prism-clike.js",
"bower_components/prism/components/prism-javascript.js",
"bower_components/prism/components/prism-json.js",
"bower_components/prism/components/prism-css-extras.js",
"bower_components/prism/components/prism-rust.js",
"bower_components/prism/plugins/line-highlight/prism-line-highlight.js",
Expand Down
2 changes: 1 addition & 1 deletion kuma/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,12 +988,12 @@ def pipeline_one_scss(slug, **kwargs):
"js/libs/prism/prism-css.js",
"js/libs/prism/prism-clike.js",
"js/libs/prism/prism-javascript.js",
"js/libs/prism/prism-json.js",
"js/libs/prism/prism-css-extras.js",
"js/libs/prism/prism-rust.js",
"js/libs/prism/prism-line-highlight.js",
"js/libs/prism/prism-line-numbers.js",

'js/prism-mdn/components/prism-json.js',
'js/syntax-prism.js',
),
'output_filename': 'build/js/syntax-prism.js',
Expand Down
14 changes: 14 additions & 0 deletions kuma/static/js/libs/prism/prism-json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Prism.languages.json = {
'property': /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/i,
'string': {
pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
greedy: true
},
'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,
'punctuation': /[{}[\]);,]/,
'operator': /:/g,
'boolean': /\b(?:true|false)\b/i,
'null': /\bnull\b/i
};

Prism.languages.jsonp = Prism.languages.json;
3 changes: 0 additions & 3 deletions kuma/static/js/prism-mdn/components/prism-json.css

This file was deleted.

4 changes: 0 additions & 4 deletions kuma/static/js/prism-mdn/components/prism-json.js

This file was deleted.

8 changes: 5 additions & 3 deletions kuma/static/styles/libs/prism/prism.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
Expand Down Expand Up @@ -62,6 +62,7 @@ pre[class*="language-"] {
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}

.token.comment,
Expand Down Expand Up @@ -103,7 +104,7 @@ pre[class*="language-"] {
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}

Expand All @@ -113,7 +114,8 @@ pre[class*="language-"] {
color: #07a;
}

.token.function {
.token.function,
.token.class-name {
color: #DD4A68;
}

Expand Down

0 comments on commit d68ee9c

Please sign in to comment.