Skip to content

Commit 2aa89a7

Browse files
Merge branch 'master' into regex-test-coverage
2 parents a23014b + 01cc18e commit 2aa89a7

36 files changed

Lines changed: 83 additions & 40 deletions

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ module.exports = {
88

99
// stylistic rules
1010
'brace-style': ['warn', '1tbs', { allowSingleLine: true }],
11+
'curly': ['warn', 'all'],
12+
'eol-last': 'warn',
13+
'no-multiple-empty-lines': ['warn', { max: 2, maxBOF: 0, maxEOF: 0 }],
1114
'no-tabs': ['warn', { allowIndentationTabs: true }],
1215
'no-var': 'error',
1316
'one-var': ['warn', 'never'],

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Prism depends on community contributions to expand and cover a wider array of us
1717

1818
- Read the [documentation](https://prismjs.com/extending.html). Prism was designed to be extensible.
1919
- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the `components/` folder. `prism.js` and all minified files are also generated automatically by our build system.
20+
- Use `npm ci` to install Prism's dependencies. Do not use `npm install` because it will cause non-deterministic builds.
2021
- The build system uses [gulp](https://github.com/gulpjs/gulp) to minify the files and build `prism.js`. With all of Prism's dependencies installed, you just need to run the command `npm run build`.
2122
- Please follow the code conventions used in the files already. For example, I use [tabs for indentation and spaces for alignment](http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/). Opening braces are on the same line, closing braces on their own line regardless of construct. There is a space before the opening brace. etc etc.
2223
- Please try to err towards more smaller PRs rather than a few huge PRs. If a PR includes changes that I want to merge and also changes that I don't, handling it becomes difficult.

assets/code.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@
119119

120120
// calc()
121121
(function () {
122-
if (!window.PrefixFree) return;
122+
if (!window.PrefixFree) {
123+
return;
124+
}
123125

124126
if (PrefixFree.functions.indexOf('calc') == -1) {
125127
var style = document.createElement('_').style;

assets/download.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,16 @@
187187
}
188188

189189
function getLanguageTitle(lang) {
190-
if (!lang.aliasTitles)
190+
if (!lang.aliasTitles) {
191191
return lang.title;
192+
}
192193

193194
var titles = [lang.title];
194-
for (var alias in lang.aliasTitles)
195-
if (lang.aliasTitles.hasOwnProperty(alias))
195+
for (var alias in lang.aliasTitles) {
196+
if (lang.aliasTitles.hasOwnProperty(alias)) {
196197
titles.push(lang.aliasTitles[alias]);
198+
}
199+
}
197200
return titles.join(' + ');
198201
}
199202

components/prism-abap.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/prism-ada.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ Prism.languages.ada = {
1616
'punctuation': /\.\.?|[,;():]/,
1717
'char': /'.'/,
1818
'variable': /\b[a-z](?:[_a-z\d])*\b/i
19-
};
19+
};

components/prism-arff.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Prism.languages.arff = {
77
'keyword': /@(?:attribute|data|end|relation)\b/i,
88
'number': /\b\d+(?:\.\d+)?\b/,
99
'punctuation': /[{},]/
10-
};
10+
};

components/prism-bbcode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Prism.languages.bbcode = {
2626
}
2727
};
2828

29-
Prism.languages.shortcode = Prism.languages.bbcode;
29+
Prism.languages.shortcode = Prism.languages.bbcode;

components/prism-brainfuck.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ Prism.languages.brainfuck = {
1717
},
1818
'operator': /[.,]/,
1919
'comment': /\S+/
20-
};
20+
};

components/prism-csp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Prism.languages.csp = {
2626
pattern: /(?:'unsafe-(?:allow-redirects|dynamic|eval|hash-attributes|hashed-attributes|hashes|inline)'|\*)/i,
2727
alias: 'function'
2828
}
29-
};
29+
};

0 commit comments

Comments
 (0)