ESLint: Added spacing rules (#2862)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758
diff --git a/.eslintrc.js b/.eslintrc.js
index ae60a75..c2fcc13 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -14,6 +14,30 @@ module.exports = {
'semi': 'warn',
'wrap-iife': 'warn',
+ // spaces
+ 'arrow-spacing': 'warn',
+ 'block-spacing': 'warn',
+ 'comma-spacing': 'warn',
+ 'computed-property-spacing': 'warn',
+ 'func-call-spacing': 'warn',
+ 'generator-star-spacing': 'warn',
+ 'key-spacing': 'warn',
+ 'keyword-spacing': 'warn',
+ 'no-multi-spaces': ['warn', { ignoreEOLComments: true }],
+ 'no-trailing-spaces': 'warn',
+ 'no-whitespace-before-property': 'warn',
+ 'object-curly-spacing': ['warn', 'always'],
+ 'rest-spread-spacing': 'warn',
+ 'semi-spacing': 'warn',
+ 'space-before-blocks': 'warn',
+ 'space-before-function-paren': ['warn', { named: 'never' }],
+ 'space-in-parens': 'warn',
+ 'space-infix-ops': ['warn', { int32Hint: true }],
+ 'space-unary-ops': 'warn',
+ 'switch-colon-spacing': 'warn',
+ 'template-curly-spacing': 'warn',
+ 'yield-star-spacing': 'warn',
+
// JSDoc
'jsdoc/check-alignment': 'warn',
'jsdoc/check-syntax': 'warn',
diff --git a/assets/code.js b/assets/code.js
index 6ea8979..03492e9 100644
--- a/assets/code.js
+++ b/assets/code.js
@@ -1,23 +1,23 @@
-(function(){
+(function () {
-if(!document.body.addEventListener) {
+if (!document.body.addEventListener) {
return;
}
$$('[data-plugin-header]').forEach(function (element) {
var plugin = components.plugins[element.getAttribute('data-plugin-header')];
element.innerHTML = '<div class="intro" data-src="assets/templates/header-plugins.html" data-type="text/html"></div>\n'
- + '<h2>' + plugin.title + '</h2>\n<p>' + plugin.description + '</p>';
+ + '<h2>' + plugin.title + '</h2>\n<p>' + plugin.description + '</p>';
});
-$$('[data-src][data-type="text/html"]').forEach(function(element) {
+$$('[data-src][data-type="text/html"]').forEach(function (element) {
var src = element.getAttribute('data-src');
var html = element.getAttribute('data-type') === 'text/html';
var contentProperty = html ? 'innerHTML' : 'textContent';
$u.xhr({
url: src,
- callback: function(xhr) {
+ callback: function (xhr) {
try {
element[contentProperty] = xhr.responseText;
@@ -38,10 +38,10 @@ $$('[data-src][data-type="text/html"]').forEach(function(element) {
/**
* Table of contents
*/
-(function(){
+(function () {
var toc = document.createElement('ol');
-$$('body > section > h1').forEach(function(h1) {
+$$('body > section > h1').forEach(function (h1) {
var section = h1.parentNode;
var text = h1.textContent;
var id = h1.id || section.id;
@@ -118,21 +118,21 @@ if (toc.children.length > 0) {
}());
// calc()
-(function(){
- if(!window.PrefixFree) return;
+(function () {
+ if (!window.PrefixFree) return;
if (PrefixFree.functions.indexOf('calc') == -1) {
var style = document.createElement('_').style;
style.width = 'calc(1px + 1%)';
- if(!style.width) {
+ if (!style.width) {
// calc not supported
var header = $('header');
var footer = $('footer');
function calculatePadding() {
header.style.padding =
- footer.style.padding = '30px ' + (innerWidth/2 - 450) + 'px';
+ footer.style.padding = '30px ' + (innerWidth / 2 - 450) + 'px';
}
addEventListener('resize', calculatePadding);
@@ -144,7 +144,7 @@ if (toc.children.length > 0) {
// setTheme is intentionally global,
// so it can be accessed from download.js
var setTheme;
-(function() {
+(function () {
var p = $u.element.create('p', {
properties: {
id: 'theme'
@@ -166,7 +166,7 @@ if (!(current in themes)) {
if (current === undefined) {
var stored = localStorage.getItem('theme');
- current = stored in themes? stored : 'prism';
+ current = stored in themes ? stored : 'prism';
}
setTheme = function (id) {
@@ -208,7 +208,7 @@ for (var id in themes) {
setTheme(current);
}());
-(function(){
+(function () {
function listPlugins(ul) {
for (var id in components.plugins) {
diff --git a/assets/download.js b/assets/download.js
index b86b426..47b6864 100644
--- a/assets/download.js
+++ b/assets/download.js
@@ -2,7 +2,7 @@
* Manage downloads
*/
-(function() {
+(function () {
var cache = {};
var form = $('form');
@@ -11,10 +11,10 @@ var minified = true;
var dependencies = {};
var treeURL = 'https://api.github.com/repos/PrismJS/prism/git/trees/master?recursive=1';
-var treePromise = new Promise(function(resolve) {
+var treePromise = new Promise(function (resolve) {
$u.xhr({
url: treeURL,
- callback: function(xhr) {
+ callback: function (xhr) {
if (xhr.status < 400) {
resolve(JSON.parse(xhr.responseText).tree);
}
@@ -39,7 +39,7 @@ function toArray(value) {
var hstr = window.location.hash.match(/(?:languages|plugins)=[-+\w]+|themes=[-\w]+/g);
if (hstr) {
- hstr.forEach(function(str) {
+ hstr.forEach(function (str) {
var kv = str.split('=', 2);
var category = kv[0];
var ids = kv[1].split('+');
@@ -111,10 +111,10 @@ for (var category in components) {
name: 'check-all-' + category,
value: '',
checked: false,
- onclick: (function(category, all){
+ onclick: (function (category, all) {
return function () {
var checkAll = this;
- $$('input[name="download-' + category + '"]').forEach(function(input) {
+ $$('input[name="download-' + category + '"]').forEach(function (input) {
all[input.value].enabled = input.checked = checkAll.checked;
});
@@ -130,7 +130,7 @@ for (var category in components) {
}
for (var id in all) {
- if(id === 'meta') {
+ if (id === 'meta') {
continue;
}
@@ -205,19 +205,19 @@ for (var category in components) {
{
tag: 'input',
properties: {
- type: all.meta.exclusive? 'radio' : 'checkbox',
+ type: all.meta.exclusive ? 'radio' : 'checkbox',
name: 'download-' + category,
value: id,
checked: checked,
disabled: disabled,
- onclick: (function(id, category, all){
+ onclick: (function (id, category, all) {
return function () {
- $$('input[name="' + this.name + '"]').forEach(function(input) {
+ $$('input[name="' + this.name + '"]').forEach(function (input) {
all[input.value].enabled = input.checked;
});
if (all[id].require && this.checked) {
- all[id].require.forEach(function(v) {
+ all[id].require.forEach(function (v) {
var input = $('label[data-id="' + v + '"] > input');
input.checked = true;
@@ -226,7 +226,7 @@ for (var category in components) {
}
if (dependencies[id] && !this.checked) { // It’s required by others
- dependencies[id].forEach(function(dependent) {
+ dependencies[id].forEach(function (dependent) {
var input = $('label[data-id="' + dependent + '"] > input');
input.checked = false;
@@ -239,7 +239,7 @@ for (var category in components) {
}(id, category, all))
}
},
- all.meta.link? {
+ all.meta.link ? {
tag: 'a',
properties: {
href: all.meta.link.replace(/\{id}/g, id),
@@ -254,7 +254,7 @@ for (var category in components) {
contents: getLanguageTitle(info)
},
' ',
- all[id].owner? {
+ all[id].owner ? {
tag: 'a',
properties: {
href: 'https://github.com/' + all[id].owner,
@@ -290,16 +290,16 @@ for (var category in components) {
}
form.elements.compression[0].onclick =
-form.elements.compression[1].onclick = function() {
+form.elements.compression[1].onclick = function () {
minified = !!+this.value;
getFilesSizes();
};
function getFileSize(filepath) {
- return treePromise.then(function(tree) {
- for(var i=0, l=tree.length; i<l; i++) {
- if(tree[i].path === filepath) {
+ return treePromise.then(function (tree) {
+ for (var i = 0, l = tree.length; i < l; i++) {
+ if (tree[i].path === filepath) {
return tree[i].size;
}
}
@@ -311,21 +311,21 @@ function getFilesSizes() {
var all = components[category];
for (var id in all) {
- if(id === 'meta') {
+ if (id === 'meta') {
continue;
}
- var distro = all[id].files[minified? 'minified' : 'dev'];
+ var distro = all[id].files[minified ? 'minified' : 'dev'];
var files = distro.paths;
files.forEach(function (filepath) {
var file = cache[filepath] = cache[filepath] || {};
- if(!file.size) {
+ if (!file.size) {
- (function(category, id) {
- getFileSize(filepath).then(function(size) {
- if(size) {
+ (function (category, id) {
+ getFileSize(filepath).then(function (size) {
+ if (size) {
file.size = size;
distro.size += file.size;
@@ -344,10 +344,10 @@ function getFilesSizes() {
getFilesSizes();
function getFileContents(filepath) {
- return new Promise(function(resolve, reject) {
+ return new Promise(function (resolve, reject) {
$u.xhr({
url: filepath,
- callback: function(xhr) {
+ callback: function (xhr) {
if (xhr.status < 400 && xhr.responseText) {
resolve(xhr.responseText);
} else {
@@ -359,12 +359,12 @@ function getFileContents(filepath) {
}
function prettySize(size) {
- return Math.round(100 * size / 1024)/100 + 'KB';
+ return Math.round(100 * size / 1024) / 100 + 'KB';
}
-function update(updatedCategory, updatedId){
+function update(updatedCategory, updatedId) {
// Update total size
- var total = {js: 0, css: 0}, updated = {js: 0, css: 0};
+ var total = { js: 0, css: 0 }, updated = { js: 0, css: 0 };
for (var category in components) {
var all = components[category];
@@ -374,9 +374,9 @@ function update(updatedCategory, updatedId){
var info = all[id];
if (info.enabled || id == updatedId) {
- var distro = info.files[minified? 'minified' : 'dev'];
+ var distro = info.files[minified ? 'minified' : 'dev'];
- distro.paths.forEach(function(path) {
+ distro.paths.forEach(function (path) {
if (cache[path]) {
var file = cache[path];
@@ -448,14 +448,14 @@ function update(updatedCategory, updatedId){
var timerId = 0;
// "debounce" multiple rapid requests to generate and highlight code
-function delayedGenerateCode(){
- if ( timerId !== 0 ) {
+function delayedGenerateCode() {
+ if (timerId !== 0) {
clearTimeout(timerId);
}
timerId = setTimeout(generateCode, 500);
}
-function generateCode(){
+function generateCode() {
/** @type {CodePromiseInfo[]} */
var promises = [];
var redownload = {};
@@ -493,7 +493,7 @@ function generateCode(){
var error = $('#download .error');
error.style.display = '';
- Promise.all([buildCode(promises), getVersion()]).then(function(arr) {
+ Promise.all([buildCode(promises), getVersion()]).then(function (arr) {
var res = arr[0];
var version = arr[1];
var code = res.code;
@@ -509,7 +509,7 @@ function generateCode(){
for (var category in redownload) {
redownloadUrl += category + '=' + redownload[category].join('+') + '&';
}
- redownloadUrl = redownloadUrl.replace(/&$/,'');
+ redownloadUrl = redownloadUrl.replace(/&$/, '');
window.location.replace(redownloadUrl);
var versionComment = '/* PrismJS ' + version + '\n' + redownloadUrl + ' */';
@@ -584,18 +584,18 @@ function buildCode(promises) {
// build
var i = 0;
var l = promises.length;
- var code = {js: '', css: ''};
+ var code = { js: '', css: '' };
var errors = [];
- var f = function(resolve) {
- if(i < l) {
+ var f = function (resolve) {
+ if (i < l) {
var p = promises[i];
- p.contentsPromise.then(function(contents) {
+ p.contentsPromise.then(function (contents) {
code[p.type] += contents + (p.type === 'js' && !/;\s*$/.test(contents) ? ';' : '') + '\n';
i++;
f(resolve);
});
- p.contentsPromise['catch'](function() {
+ p.contentsPromise['catch'](function () {
errors.push($u.element.create({
tag: 'p',
prop: {
@@ -606,7 +606,7 @@ function buildCode(promises) {
f(resolve);
});
} else {
- resolve({code: code, errors: errors});
+ resolve({ code: code, errors: errors });
}
};
diff --git a/assets/examples.js b/assets/examples.js
index ff9f6a5..f4708b3 100644
--- a/assets/examples.js
+++ b/assets/examples.js
@@ -2,7 +2,7 @@
* Manage examples
*/
-(function() {
+(function () {
var examples = {};
diff --git a/components/prism-abap.js b/components/prism-abap.js
index 64ae744..1e0d963 100644
--- a/components/prism-abap.js
+++ b/components/prism-abap.js
@@ -1,12 +1,12 @@
Prism.languages.abap = {
'comment': /^\*.*/m,
- 'string' : /(`|')(?:\\.|(?!\1)[^\\\r\n])*\1/m,
+ 'string': /(`|')(?:\\.|(?!\1)[^\\\r\n])*\1/m,
'string-template': {
pattern: /([|}])(?:\\.|[^\\|{\r\n])*(?=[|{])/,
lookbehind: true,
alias: 'string'
},
- /* End Of Line comments should not interfere with strings when the
+ /* End Of Line comments should not interfere with strings when the
quote character occurs within them. We assume a string being highlighted
inside an EOL comment is more acceptable than the opposite.
*/
@@ -15,26 +15,26 @@ Prism.languages.abap = {
lookbehind: true,
alias: 'comment'
},
- 'keyword' : {
+ 'keyword': {
pattern: /(\s|\.|^)(?:SCIENTIFIC_WITH_LEADING_ZERO|SCALE_PRESERVING_SCIENTIFIC|RMC_COMMUNICATION_FAILURE|END-ENHANCEMENT-SECTION|MULTIPLY-CORRESPONDING|SUBTRACT-CORRESPONDING|VERIFICATION-MESSAGE|DIVIDE-CORRESPONDING|ENHANCEMENT-SECTION|CURRENCY_CONVERSION|RMC_SYSTEM_FAILURE|START-OF-SELECTION|MOVE-CORRESPONDING|RMC_INVALID_STATUS|CUSTOMER-FUNCTION|END-OF-DEFINITION|ENHANCEMENT-POINT|SYSTEM-EXCEPTIONS|ADD-CORRESPONDING|SCALE_PRESERVING|SELECTION-SCREEN|CURSOR-SELECTION|END-OF-SELECTION|LOAD-OF-PROGRAM|SCROLL-BOUNDARY|SELECTION-TABLE|EXCEPTION-TABLE|IMPLEMENTATIONS|PARAMETER-TABLE|RIGHT-JUSTIFIED|UNIT_CONVERSION|AUTHORITY-CHECK|LIST-PROCESSING|SIGN_AS_POSTFIX|COL_BACKGROUND|IMPLEMENTATION|INTERFACE-POOL|TRANSFORMATION|IDENTIFICATION|ENDENHANCEMENT|LINE-SELECTION|INITIALIZATION|LEFT-JUSTIFIED|SELECT-OPTIONS|SELECTION-SETS|COMMUNICATION|CORRESPONDING|DECIMAL_SHIFT|PRINT-CONTROL|VALUE-REQUEST|CHAIN-REQUEST|FUNCTION-POOL|FIELD-SYMBOLS|FUNCTIONALITY|INVERTED-DATE|SELECTION-SET|CLASS-METHODS|OUTPUT-LENGTH|CLASS-CODING|COL_NEGATIVE|ERRORMESSAGE|FIELD-GROUPS|HELP-REQUEST|NO-EXTENSION|NO-TOPOFPAGE|REDEFINITION|DISPLAY-MODE|ENDINTERFACE|EXIT-COMMAND|FIELD-SYMBOL|NO-SCROLLING|SHORTDUMP-ID|ACCESSPOLICY|CLASS-EVENTS|COL_POSITIVE|DECLARATIONS|ENHANCEMENTS|FILTER-TABLE|SWITCHSTATES|SYNTAX-CHECK|TRANSPORTING|ASYNCHRONOUS|SYNTAX-TRACE|TOKENIZATION|USER-COMMAND|WITH-HEADING|ABAP-SOURCE|BREAK-POINT|CHAIN-INPUT|COMPRESSION|FIXED-POINT|NEW-SECTION|NON-UNICODE|OCCURRENCES|RESPONSIBLE|SYSTEM-CALL|TRACE-TABLE|ABBREVIATED|CHAR-TO-HEX|END-OF-FILE|ENDFUNCTION|ENVIRONMENT|ASSOCIATION|COL_HEADING|EDITOR-CALL|END-OF-PAGE|ENGINEERING|IMPLEMENTED|INTENSIFIED|RADIOBUTTON|SYSTEM-EXIT|TOP-OF-PAGE|TRANSACTION|APPLICATION|CONCATENATE|DESTINATION|ENHANCEMENT|IMMEDIATELY|NO-GROUPING|PRECOMPILED|REPLACEMENT|TITLE-LINES|ACTIVATION|BYTE-ORDER|CLASS-POOL|CONNECTION|CONVERSION|DEFINITION|DEPARTMENT|EXPIRATION|INHERITING|MESSAGE-ID|NO-HEADING|PERFORMING|QUEUE-ONLY|RIGHTSPACE|SCIENTIFIC|STATUSINFO|STRUCTURES|SYNCPOINTS|WITH-TITLE|ATTRIBUTES|BOUNDARIES|CLASS-DATA|COL_NORMAL|DD\/MM\/YYYY|DESCENDING|INTERFACES|LINE-COUNT|MM\/DD\/YYYY|NON-UNIQUE|PRESERVING|SELECTIONS|STATEMENTS|SUBROUTINE|TRUNCATION|TYPE-POOLS|ARITHMETIC|BACKGROUND|ENDPROVIDE|EXCEPTIONS|IDENTIFIER|INDEX-LINE|OBLIGATORY|PARAMETERS|PERCENTAGE|PUSHBUTTON|RESOLUTION|COMPONENTS|DEALLOCATE|DISCONNECT|DUPLICATES|FIRST-LINE|HEAD-LINES|NO-DISPLAY|OCCURRENCE|RESPECTING|RETURNCODE|SUBMATCHES|TRACE-FILE|ASCENDING|BYPASSING|ENDMODULE|EXCEPTION|EXCLUDING|EXPORTING|INCREMENT|MATCHCODE|PARAMETER|PARTIALLY|PREFERRED|REFERENCE|REPLACING|RETURNING|SELECTION|SEPARATED|SPECIFIED|STATEMENT|TIMESTAMP|TYPE-POOL|ACCEPTING|APPENDAGE|ASSIGNING|COL_GROUP|COMPARING|CONSTANTS|DANGEROUS|IMPORTING|INSTANCES|LEFTSPACE|LOG-POINT|QUICKINFO|READ-ONLY|SCROLLING|SQLSCRIPT|STEP-LOOP|TOP-LINES|TRANSLATE|APPENDING|AUTHORITY|CHARACTER|COMPONENT|CONDITION|DIRECTORY|DUPLICATE|MESSAGING|RECEIVING|SUBSCREEN|ACCORDING|COL_TOTAL|END-LINES|ENDMETHOD|ENDSELECT|EXPANDING|EXTENSION|INCLUDING|INFOTYPES|INTERFACE|INTERVALS|LINE-SIZE|PF-STATUS|PROCEDURE|PROTECTED|REQUESTED|RESUMABLE|RIGHTPLUS|SAP-SPOOL|SECONDARY|STRUCTURE|SUBSTRING|TABLEVIEW|NUMOFCHAR|ADJACENT|ANALYSIS|ASSIGNED|BACKWARD|CHANNELS|CHECKBOX|CONTINUE|CRITICAL|DATAINFO|DD\/MM\/YY|DURATION|ENCODING|ENDCLASS|FUNCTION|LEFTPLUS|LINEFEED|MM\/DD\/YY|OVERFLOW|RECEIVED|SKIPPING|SORTABLE|STANDARD|SUBTRACT|SUPPRESS|TABSTRIP|TITLEBAR|TRUNCATE|UNASSIGN|WHENEVER|ANALYZER|COALESCE|COMMENTS|CONDENSE|DECIMALS|DEFERRED|ENDWHILE|EXPLICIT|KEYWORDS|MESSAGES|POSITION|PRIORITY|RECEIVER|RENAMING|TIMEZONE|TRAILING|ALLOCATE|CENTERED|CIRCULAR|CONTROLS|CURRENCY|DELETING|DESCRIBE|DISTANCE|ENDCATCH|EXPONENT|EXTENDED|GENERATE|IGNORING|INCLUDES|INTERNAL|MAJOR-ID|MODIFIER|NEW-LINE|OPTIONAL|PROPERTY|ROLLBACK|STARTING|SUPPLIED|ABSTRACT|CHANGING|CONTEXTS|CREATING|CUSTOMER|DATABASE|DAYLIGHT|DEFINING|DISTINCT|DIVISION|ENABLING|ENDCHAIN|ESCAPING|HARMLESS|IMPLICIT|INACTIVE|LANGUAGE|MINOR-ID|MULTIPLY|NEW-PAGE|NO-TITLE|POS_HIGH|SEPARATE|TEXTPOOL|TRANSFER|SELECTOR|DBMAXLEN|ITERATOR|SELECTOR|ARCHIVE|BIT-XOR|BYTE-CO|COLLECT|COMMENT|CURRENT|DEFAULT|DISPLAY|ENDFORM|EXTRACT|LEADING|LISTBOX|LOCATOR|MEMBERS|METHODS|NESTING|POS_LOW|PROCESS|PROVIDE|RAISING|RESERVE|SECONDS|SUMMARY|VISIBLE|BETWEEN|BIT-AND|BYTE-CS|CLEANUP|COMPUTE|CONTROL|CONVERT|DATASET|ENDCASE|FORWARD|HEADERS|HOTSPOT|INCLUDE|INVERSE|KEEPING|NO-ZERO|OBJECTS|OVERLAY|PADDING|PATTERN|PROGRAM|REFRESH|SECTION|SUMMING|TESTING|VERSION|WINDOWS|WITHOUT|BIT-NOT|BYTE-CA|BYTE-NA|CASTING|CONTEXT|COUNTRY|DYNAMIC|ENABLED|ENDLOOP|EXECUTE|FRIENDS|HANDLER|HEADING|INITIAL|\*-INPUT|LOGFILE|MAXIMUM|MINIMUM|NO-GAPS|NO-SIGN|PRAGMAS|PRIMARY|PRIVATE|REDUCED|REPLACE|REQUEST|RESULTS|UNICODE|WARNING|ALIASES|BYTE-CN|BYTE-NS|CALLING|COL_KEY|COLUMNS|CONNECT|ENDEXEC|ENTRIES|EXCLUDE|FILTERS|FURTHER|HELP-ID|LOGICAL|MAPPING|MESSAGE|NAMETAB|OPTIONS|PACKAGE|PERFORM|RECEIVE|STATICS|VARYING|BINDING|CHARLEN|GREATER|XSTRLEN|ACCEPT|APPEND|DETAIL|ELSEIF|ENDING|ENDTRY|FORMAT|FRAMES|GIVING|HASHED|HEADER|IMPORT|INSERT|MARGIN|MODULE|NATIVE|OBJECT|OFFSET|REMOTE|RESUME|SAVING|SIMPLE|SUBMIT|TABBED|TOKENS|UNIQUE|UNPACK|UPDATE|WINDOW|YELLOW|ACTUAL|ASPECT|CENTER|CURSOR|DELETE|DIALOG|DIVIDE|DURING|ERRORS|EVENTS|EXTEND|FILTER|HANDLE|HAVING|IGNORE|LITTLE|MEMORY|NO-GAP|OCCURS|OPTION|PERSON|PLACES|PUBLIC|REDUCE|REPORT|RESULT|SINGLE|SORTED|SWITCH|SYNTAX|TARGET|VALUES|WRITER|ASSERT|BLOCKS|BOUNDS|BUFFER|CHANGE|COLUMN|COMMIT|CONCAT|COPIES|CREATE|DDMMYY|DEFINE|ENDIAN|ESCAPE|EXPAND|KERNEL|LAYOUT|LEGACY|LEVELS|MMDDYY|NUMBER|OUTPUT|RANGES|READER|RETURN|SCREEN|SEARCH|SELECT|SHARED|SOURCE|STABLE|STATIC|SUBKEY|SUFFIX|TABLES|UNWIND|YYMMDD|ASSIGN|BACKUP|BEFORE|BINARY|BIT-OR|BLANKS|CLIENT|CODING|COMMON|DEMAND|DYNPRO|EXCEPT|EXISTS|EXPORT|FIELDS|GLOBAL|GROUPS|LENGTH|LOCALE|MEDIUM|METHOD|MODIFY|NESTED|OTHERS|REJECT|SCROLL|SUPPLY|SYMBOL|ENDFOR|STRLEN|ALIGN|BEGIN|BOUND|ENDAT|ENTRY|EVENT|FINAL|FLUSH|GRANT|INNER|SHORT|USING|WRITE|AFTER|BLACK|BLOCK|CLOCK|COLOR|COUNT|DUMMY|EMPTY|ENDDO|ENDON|GREEN|INDEX|INOUT|LEAVE|LEVEL|LINES|MODIF|ORDER|OUTER|RANGE|RESET|RETRY|RIGHT|SMART|SPLIT|STYLE|TABLE|THROW|UNDER|UNTIL|UPPER|UTF-8|WHERE|ALIAS|BLANK|CLEAR|CLOSE|EXACT|FETCH|FIRST|FOUND|GROUP|LLANG|LOCAL|OTHER|REGEX|SPOOL|TITLE|TYPES|VALID|WHILE|ALPHA|BOXED|CATCH|CHAIN|CHECK|CLASS|COVER|ENDIF|EQUIV|FIELD|FLOOR|FRAME|INPUT|LOWER|MATCH|NODES|PAGES|PRINT|RAISE|ROUND|SHIFT|SPACE|SPOTS|STAMP|STATE|TASKS|TIMES|TRMAC|ULINE|UNION|VALUE|WIDTH|EQUAL|LOG10|TRUNC|BLOB|CASE|CEIL|CLOB|COND|EXIT|FILE|GAPS|HOLD|INCL|INTO|KEEP|KEYS|LAST|LINE|LONG|LPAD|MAIL|MODE|OPEN|PINK|READ|ROWS|TEST|THEN|ZERO|AREA|BACK|BADI|BYTE|CAST|EDIT|EXEC|FAIL|FIND|FKEQ|FONT|FREE|GKEQ|HIDE|INIT|ITNO|LATE|LOOP|MAIN|MARK|MOVE|NEXT|NULL|RISK|ROLE|UNIT|WAIT|ZONE|BASE|CALL|CODE|DATA|DATE|FKGE|GKGE|HIGH|KIND|LEFT|LIST|MASK|MESH|NAME|NODE|PACK|PAGE|POOL|SEND|SIGN|SIZE|SOME|STOP|TASK|TEXT|TIME|USER|VARY|WITH|WORD|BLUE|CONV|COPY|DEEP|ELSE|FORM|FROM|HINT|ICON|JOIN|LIKE|LOAD|ONLY|PART|SCAN|SKIP|SORT|TYPE|UNIX|VIEW|WHEN|WORK|ACOS|ASIN|ATAN|COSH|EACH|FRAC|LESS|RTTI|SINH|SQRT|TANH|AVG|BIT|DIV|ISO|LET|OUT|PAD|SQL|ALL|CI_|CPI|END|LOB|LPI|MAX|MIN|NEW|OLE|RUN|SET|\?TO|YES|ABS|ADD|AND|BIG|FOR|HDB|JOB|LOW|NOT|SAP|TRY|VIA|XML|ANY|GET|IDS|KEY|MOD|OFF|PUT|RAW|RED|REF|SUM|TAB|XSD|CNT|COS|EXP|LOG|SIN|TAN|XOR|AT|CO|CP|DO|GT|ID|IF|NS|OR|BT|CA|CS|GE|NA|NB|EQ|IN|LT|NE|NO|OF|ON|PF|TO|AS|BY|CN|IS|LE|NP|UP|E|I|M|O|Z|C|X)\b/i,
lookbehind: true
},
/* Numbers can be only integers. Decimal or Hex appear only as strings */
- 'number' : /\b\d+\b/,
- /* Operators must always be surrounded by whitespace, they cannot be put
- adjacent to operands.
+ 'number': /\b\d+\b/,
+ /* Operators must always be surrounded by whitespace, they cannot be put
+ adjacent to operands.
*/
- 'operator' : {
+ 'operator': {
pattern: /(\s)(?:\*\*?|<[=>]?|>=?|\?=|[-+\/=])(?=\s)/,
lookbehind: true
},
- 'string-operator' : {
+ 'string-operator': {
pattern: /(\s)&&?(?=\s)/,
lookbehind: true,
/* The official editor highlights */
alias: 'keyword'
},
- 'token-operator' : [{
+ 'token-operator': [{
/* Special operators used to access structure components, class methods/attributes, etc. */
pattern: /(\w)(?:->?|=>|[~|{}])(?=\w)/,
lookbehind: true,
@@ -44,5 +44,5 @@ Prism.languages.abap = {
pattern: /[|{}]/,
alias: 'punctuation'
}],
- 'punctuation' : /[,.:()]/
+ 'punctuation': /[,.:()]/
};
\ No newline at end of file
diff --git a/components/prism-actionscript.js b/components/prism-actionscript.js
index cac4cd0..530bc77 100644
--- a/components/prism-actionscript.js
+++ b/components/prism-actionscript.js
@@ -1,4 +1,4 @@
-Prism.languages.actionscript = Prism.languages.extend('javascript', {
+Prism.languages.actionscript = Prism.languages.extend('javascript', {
'keyword': /\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/,
'operator': /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/
});
diff --git a/components/prism-bash.js b/components/prism-bash.js
index 80a0449..d771e64 100644
--- a/components/prism-bash.js
+++ b/components/prism-bash.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
// $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
// + LC_ALL, RANDOM, REPLY, SECONDS.
// + make sure PS1..4 are here as they are not always set,
@@ -219,7 +219,7 @@
'number'
];
var inside = insideString.variable[1].inside;
- for(var i = 0; i < toBeCopied.length; i++) {
+ for (var i = 0; i < toBeCopied.length; i++) {
inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]];
}
diff --git a/components/prism-bro.js b/components/prism-bro.js
index f9779ae..3de66ee 100644
--- a/components/prism-bro.js
+++ b/components/prism-bro.js
@@ -4,7 +4,7 @@ Prism.languages.bro = {
pattern: /(^|[^\\$])#.*/,
lookbehind: true,
inside: {
- 'italic': /\b(?:TODO|FIXME|XXX)\b/
+ 'italic': /\b(?:TODO|FIXME|XXX)\b/
}
},
diff --git a/components/prism-coffeescript.js b/components/prism-coffeescript.js
index f17f85b..933c4a6 100644
--- a/components/prism-coffeescript.js
+++ b/components/prism-coffeescript.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
// Ignore comments starting with { to privilege string interpolation highlighting
var comment = /#(?!\{).+/;
diff --git a/components/prism-core.js b/components/prism-core.js
index d19999d..965e3a2 100644
--- a/components/prism-core.js
+++ b/components/prism-core.js
@@ -16,7 +16,7 @@ var _self = (typeof window !== 'undefined')
* @namespace
* @public
*/
-var Prism = (function (_self){
+var Prism = (function (_self) {
// Private helper vars
var lang = /\blang(?:uage)?-([\w-]+)\b/i;
@@ -407,7 +407,7 @@ var _ = {
root[inside] = ret;
// Update references in other language definitions
- _.languages.DFS(_.languages, function(key, value) {
+ _.languages.DFS(_.languages, function (key, value) {
if (value === old && key != inside) {
this[key] = ret;
}
@@ -455,7 +455,7 @@ var _ = {
* @memberof Prism
* @public
*/
- highlightAll: function(async, callback) {
+ highlightAll: function (async, callback) {
_.highlightAllUnder(document, async, callback);
},
@@ -474,7 +474,7 @@ var _ = {
* @memberof Prism
* @public
*/
- highlightAllUnder: function(container, async, callback) {
+ highlightAllUnder: function (container, async, callback) {
var env = {
callback: callback,
container: container,
@@ -520,7 +520,7 @@ var _ = {
* @memberof Prism
* @public
*/
- highlightElement: function(element, async, callback) {
+ highlightElement: function (element, async, callback) {
// Find language
var language = _.util.getLanguage(element);
var grammar = _.languages[language];
@@ -579,7 +579,7 @@ var _ = {
if (async && _self.Worker) {
var worker = new Worker(_.filename);
- worker.onmessage = function(evt) {
+ worker.onmessage = function (evt) {
insertHighlightedCode(evt.data);
};
@@ -649,7 +649,7 @@ var _ = {
* }
* });
*/
- tokenize: function(text, grammar) {
+ tokenize: function (text, grammar) {
var rest = grammar.rest;
if (rest) {
for (var token in rest) {
@@ -711,7 +711,7 @@ var _ = {
return;
}
- for (var i=0, callback; (callback = callbacks[i++]);) {
+ for (var i = 0, callback; (callback = callbacks[i++]);) {
callback(env);
}
}
diff --git a/components/prism-crystal.js b/components/prism-crystal.js
index 12669a6..1aef89a 100644
--- a/components/prism-crystal.js
+++ b/components/prism-crystal.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
Prism.languages.crystal = Prism.languages.extend('ruby', {
keyword: [
/\b(?:abstract|alias|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|rescue|return|require|select|self|sizeof|struct|super|then|type|typeof|uninitialized|union|unless|until|when|while|with|yield|__DIR__|__END_LINE__|__FILE__|__LINE__)\b/,
diff --git a/components/prism-dart.js b/components/prism-dart.js
index 0101e46..8d1687d 100644
--- a/components/prism-dart.js
+++ b/components/prism-dart.js
@@ -46,14 +46,14 @@
'operator': /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/
});
- Prism.languages.insertBefore('dart','function',{
+ Prism.languages.insertBefore('dart', 'function', {
'metadata': {
pattern: /@\w+/,
alias: 'symbol'
}
});
- Prism.languages.insertBefore('dart','class-name',{
+ Prism.languages.insertBefore('dart', 'class-name', {
'generics': {
pattern: /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,
inside: {
diff --git a/components/prism-dataweave.js b/components/prism-dataweave.js
index 4c9d46e..bf04218 100644
--- a/components/prism-dataweave.js
+++ b/components/prism-dataweave.js
@@ -1,4 +1,4 @@
-(function (Prism) {
+(function (Prism) {
Prism.languages.dataweave = {
'url': /\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/,
'property': {
@@ -9,7 +9,7 @@
pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
greedy: true
},
- 'mime-type': /\b(?:text|audio|video|application|multipart|image)\/[\w+-]+/,
+ 'mime-type': /\b(?:text|audio|video|application|multipart|image)\/[\w+-]+/,
'date': {
pattern: /\|[\w:+-]+\|/,
greedy: true
@@ -32,10 +32,10 @@
},
'function': /\b[A-Za-z_]\w*(?=\s*\()/i,
'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
- 'punctuation': /[{}[\];(),.:@]/,
+ 'punctuation': /[{}[\];(),.:@]/,
'operator': /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|\!|\?/,
'boolean': /\b(?:true|false)\b/,
'keyword': /\b(?:match|input|output|ns|type|update|null|if|else|using|unless|at|is|as|case|do|fun|var|not|and|or)\b/
};
-
+
}(Prism));
diff --git a/components/prism-ejs.js b/components/prism-ejs.js
index 047f0dd..cd590b4 100644
--- a/components/prism-ejs.js
+++ b/components/prism-ejs.js
@@ -12,12 +12,12 @@
}
};
- Prism.hooks.add('before-tokenize', function(env) {
+ Prism.hooks.add('before-tokenize', function (env) {
var ejsPattern = /<%(?!%)[\s\S]+?%>/g;
Prism.languages['markup-templating'].buildPlaceholders(env, 'ejs', ejsPattern);
});
- Prism.hooks.add('after-tokenize', function(env) {
+ Prism.hooks.add('after-tokenize', function (env) {
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'ejs');
});
diff --git a/components/prism-elixir.js b/components/prism-elixir.js
index 868e1fc..55676ad 100644
--- a/components/prism-elixir.js
+++ b/components/prism-elixir.js
@@ -82,7 +82,7 @@ Prism.languages.elixir = {
'punctuation': /<<|>>|[.,%\[\]{}()]/
};
-Prism.languages.elixir.string.forEach(function(o) {
+Prism.languages.elixir.string.forEach(function (o) {
o.inside = {
'interpolation': {
pattern: /#\{[^}]+\}/,
diff --git a/components/prism-erb.js b/components/prism-erb.js
index 5e58528..132f4f5 100644
--- a/components/prism-erb.js
+++ b/components/prism-erb.js
@@ -8,12 +8,12 @@
}
});
- Prism.hooks.add('before-tokenize', function(env) {
+ Prism.hooks.add('before-tokenize', function (env) {
var erbPattern = /<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s[\s\S]*?^=end)+?%>/gm;
Prism.languages['markup-templating'].buildPlaceholders(env, 'erb', erbPattern);
});
- Prism.hooks.add('after-tokenize', function(env) {
+ Prism.hooks.add('after-tokenize', function (env) {
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'erb');
});
diff --git a/components/prism-factor.js b/components/prism-factor.js
index efc33b4..921daac 100644
--- a/components/prism-factor.js
+++ b/components/prism-factor.js
@@ -346,7 +346,7 @@
};
var escape = function (str) {
- return (str+'').replace(/([.?*+\^$\[\]\\(){}|\-])/g, '\\$1');
+ return (str + '').replace(/([.?*+\^$\[\]\\(){}|\-])/g, '\\$1');
};
var arrToWordsRegExp = function (arr) {
@@ -375,7 +375,7 @@
};
Object.keys(builtins).forEach(function (k) {
- factor[k].pattern = arrToWordsRegExp( builtins[k] );
+ factor[k].pattern = arrToWordsRegExp(builtins[k]);
});
var combinators = [
diff --git a/components/prism-groovy.js b/components/prism-groovy.js
index 1a8a786..4bbe7c9 100644
--- a/components/prism-groovy.js
+++ b/components/prism-groovy.js
@@ -41,7 +41,7 @@ Prism.languages.insertBefore('groovy', 'function', {
});
// Handle string interpolation
-Prism.hooks.add('wrap', function(env) {
+Prism.hooks.add('wrap', function (env) {
if (env.language === 'groovy' && env.type === 'string') {
var delimiter = env.content[0];
diff --git a/components/prism-haml.js b/components/prism-haml.js
index eda53ca..69c2d6f 100644
--- a/components/prism-haml.js
+++ b/components/prism-haml.js
@@ -5,7 +5,7 @@
code |
*/
-(function(Prism) {
+(function (Prism) {
Prism.languages.haml = {
// Multiline stuff should appear before the rest
@@ -109,7 +109,7 @@
// Non exhaustive list of available filters and associated languages
var filters = [
'css',
- {filter:'coffee',language:'coffeescript'},
+ { filter: 'coffee', language: 'coffeescript' },
'erb',
'javascript',
'less',
@@ -121,7 +121,7 @@
var all_filters = {};
for (var i = 0, l = filters.length; i < l; i++) {
var filter = filters[i];
- filter = typeof filter === 'string' ? {filter: filter, language: filter} : filter;
+ filter = typeof filter === 'string' ? { filter: filter, language: filter } : filter;
if (Prism.languages[filter.language]) {
all_filters['filter-' + filter.filter] = {
pattern: RegExp(filter_pattern.replace('{{filter_name}}', function () { return filter.filter; })),
diff --git a/components/prism-handlebars.js b/components/prism-handlebars.js
index 02301ce..fbf4f1d 100644
--- a/components/prism-handlebars.js
+++ b/components/prism-handlebars.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
Prism.languages.handlebars = {
'comment': /\{\{![\s\S]*?\}\}/,
@@ -25,12 +25,12 @@
'variable': /[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/
};
- Prism.hooks.add('before-tokenize', function(env) {
+ Prism.hooks.add('before-tokenize', function (env) {
var handlebarsPattern = /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g;
Prism.languages['markup-templating'].buildPlaceholders(env, 'handlebars', handlebarsPattern);
});
- Prism.hooks.add('after-tokenize', function(env) {
+ Prism.hooks.add('after-tokenize', function (env) {
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'handlebars');
});
diff --git a/components/prism-inform7.js b/components/prism-inform7.js
index c49ce3f..5839cd3 100644
--- a/components/prism-inform7.js
+++ b/components/prism-inform7.js
@@ -6,7 +6,7 @@ Prism.languages.inform7 = {
pattern: /\[[^\]]+\]/,
inside: {
'delimiter': {
- pattern:/\[|\]/,
+ pattern: /\[|\]/,
alias: 'punctuation'
}
// See rest below
diff --git a/components/prism-ini.js b/components/prism-ini.js
index e950caf..3e261d3 100644
--- a/components/prism-ini.js
+++ b/components/prism-ini.js
@@ -1,4 +1,4 @@
-Prism.languages.ini= {
+Prism.languages.ini = {
/**
* The component mimics the behavior of the Win32 API parser.
diff --git a/components/prism-io.js b/components/prism-io.js
index 7a62203..71ef8e1 100644
--- a/components/prism-io.js
+++ b/components/prism-io.js
@@ -23,7 +23,7 @@ Prism.languages.io = {
greedy: true
},
'keyword': /\b(?:activate|activeCoroCount|asString|block|break|catch|clone|collectGarbage|compileString|continue|do|doFile|doMessage|doString|else|elseif|exit|for|foreach|forward|getSlot|getEnvironmentVariable|hasSlot|if|ifFalse|ifNil|ifNilEval|ifTrue|isActive|isNil|isResumable|list|message|method|parent|pass|pause|perform|performWithArgList|print|println|proto|raise|raiseResumable|removeSlot|resend|resume|schedulerSleepSeconds|self|sender|setSchedulerSleepSeconds|setSlot|shallowCopy|slotNames|super|system|then|thisBlock|thisContext|call|try|type|uniqueId|updateSlot|wait|while|write|yield)\b/,
- 'builtin':/\b(?:Array|AudioDevice|AudioMixer|Block|Box|Buffer|CFunction|CGI|Color|Curses|DBM|DNSResolver|DOConnection|DOProxy|DOServer|Date|Directory|Duration|DynLib|Error|Exception|FFT|File|Fnmatch|Font|Future|GL|GLE|GLScissor|GLU|GLUCylinder|GLUQuadric|GLUSphere|GLUT|Host|Image|Importer|LinkList|List|Lobby|Locals|MD5|MP3Decoder|MP3Encoder|Map|Message|Movie|Notification|Number|Object|OpenGL|Point|Protos|Regex|SGML|SGMLElement|SGMLParser|SQLite|Server|Sequence|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink|Random|BigNum)\b/,
+ 'builtin': /\b(?:Array|AudioDevice|AudioMixer|Block|Box|Buffer|CFunction|CGI|Color|Curses|DBM|DNSResolver|DOConnection|DOProxy|DOServer|Date|Directory|Duration|DynLib|Error|Exception|FFT|File|Fnmatch|Font|Future|GL|GLE|GLScissor|GLU|GLUCylinder|GLUQuadric|GLUSphere|GLUT|Host|Image|Importer|LinkList|List|Lobby|Locals|MD5|MP3Decoder|MP3Encoder|Map|Message|Movie|Notification|Number|Object|OpenGL|Point|Protos|Regex|SGML|SGMLElement|SGMLParser|SQLite|Server|Sequence|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink|Random|BigNum)\b/,
'boolean': /\b(?:true|false|nil)\b/,
'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?/i,
'operator': /[=!*/%+\-^&|]=|>>?=?|<<?=?|:?:?=|\+\+?|--?|\*\*?|\/\/?|%|\|\|?|&&?|\b(?:return|and|or|not)\b|@@?|\?\??|\.\./,
diff --git a/components/prism-jolie.js b/components/prism-jolie.js
index 9e6556e..bbe36a8 100644
--- a/components/prism-jolie.js
+++ b/components/prism-jolie.js
@@ -13,7 +13,7 @@ Prism.languages.jolie = Prism.languages.extend('clike', {
delete Prism.languages.jolie['class-name'];
-Prism.languages.insertBefore( 'jolie', 'keyword', {
+Prism.languages.insertBefore('jolie', 'keyword', {
'function':
{
pattern: /((?:\b(?:outputPort|inputPort|in|service|courier)\b|@)\s*)\w+/,
@@ -26,7 +26,7 @@ Prism.languages.insertBefore( 'jolie', 'keyword', {
'with-extension': {
pattern: /\bwith\s+\w+/,
inside: {
- 'keyword' : /\bwith\b/
+ 'keyword': /\bwith\b/
}
},
'function': {
diff --git a/components/prism-jsx.js b/components/prism-jsx.js
index b1adb39..3dc7613 100644
--- a/components/prism-jsx.js
+++ b/components/prism-jsx.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
var javascript = Prism.util.clone(Prism.languages.javascript);
@@ -38,7 +38,7 @@ Prism.languages.insertBefore('inside', 'attr-name', {
}
}, Prism.languages.jsx.tag);
-Prism.languages.insertBefore('inside', 'special-attr',{
+Prism.languages.insertBefore('inside', 'special-attr', {
'script': {
// Allow for two levels of nesting
pattern: re(/=<BRACES>/.source),
diff --git a/components/prism-latte.js b/components/prism-latte.js
index 325bc53..59f4b1e 100644
--- a/components/prism-latte.js
+++ b/components/prism-latte.js
@@ -53,7 +53,7 @@
},
}, markupLatte.tag);
- Prism.hooks.add('before-tokenize', function(env) {
+ Prism.hooks.add('before-tokenize', function (env) {
if (env.language !== 'latte') {
return;
}
@@ -62,7 +62,7 @@
env.grammar = markupLatte;
});
- Prism.hooks.add('after-tokenize', function(env) {
+ Prism.hooks.add('after-tokenize', function (env) {
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'latte');
});
diff --git a/components/prism-llvm.js b/components/prism-llvm.js
index 36f85d3..60966de 100644
--- a/components/prism-llvm.js
+++ b/components/prism-llvm.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
Prism.languages.llvm = {
'comment': /;.*/,
'string': {
diff --git a/components/prism-mongodb.js b/components/prism-mongodb.js
index cb06fc4..14bb9f8 100644
--- a/components/prism-mongodb.js
+++ b/components/prism-mongodb.js
@@ -13,7 +13,7 @@
// aggregation pipeline stages
'$addFields', '$bucket', '$bucketAuto', '$collStats', '$count', '$currentOp', '$facet', '$geoNear',
- '$graphLookup', '$group','$indexStats', '$limit', '$listLocalSessions', '$listSessions', '$lookup',
+ '$graphLookup', '$group', '$indexStats', '$limit', '$listLocalSessions', '$listSessions', '$lookup',
'$match', '$merge', '$out', '$planCacheStats', '$project', '$redact', '$replaceRoot', '$replaceWith',
'$sample', '$set', '$skip', '$sort', '$sortByCount', '$unionWith', '$unset', '$unwind',
@@ -55,7 +55,7 @@
'UUID',
];
- operators = operators.map(function(operator) {
+ operators = operators.map(function (operator) {
return operator.replace('$', '\\$');
});
diff --git a/components/prism-n4js.js b/components/prism-n4js.js
index c81e262..946b080 100755
--- a/components/prism-n4js.js
+++ b/components/prism-n4js.js
@@ -11,4 +11,4 @@ Prism.languages.insertBefore('n4js', 'constant', {
}
});
-Prism.languages.n4jsd=Prism.languages.n4js;
+Prism.languages.n4jsd = Prism.languages.n4js;
diff --git a/components/prism-pug.js b/components/prism-pug.js
index 78ccd29..94f8432 100644
--- a/components/prism-pug.js
+++ b/components/prism-pug.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
// TODO:
// - Add CSS highlighting inside <style> tags
// - Add support for multi-line code blocks
@@ -149,20 +149,20 @@
// Non exhaustive list of available filters and associated languages
var filters = [
- {filter:'atpl',language:'twig'},
- {filter:'coffee',language:'coffeescript'},
+ { filter: 'atpl', language: 'twig' },
+ { filter: 'coffee', language: 'coffeescript' },
'ejs',
'handlebars',
'less',
'livescript',
'markdown',
- {filter:'sass',language:'scss'},
+ { filter: 'sass', language: 'scss' },
'stylus'
];
var all_filters = {};
for (var i = 0, l = filters.length; i < l; i++) {
var filter = filters[i];
- filter = typeof filter === 'string' ? {filter: filter, language: filter} : filter;
+ filter = typeof filter === 'string' ? { filter: filter, language: filter } : filter;
if (Prism.languages[filter.language]) {
all_filters['filter-' + filter.filter] = {
pattern: RegExp(filter_pattern.replace('{{filter_name}}', function () { return filter.filter; }), 'm'),
diff --git a/components/prism-pure.js b/components/prism-pure.js
index accfac4..2c95f88 100644
--- a/components/prism-pure.js
+++ b/components/prism-pure.js
@@ -66,7 +66,7 @@
if (Prism.languages[alias]) {
var o = {};
o['inline-lang-' + alias] = {
- pattern: RegExp(inlineLanguageRe.replace('{lang}', lang.replace(/([.+*?\/\\(){}\[\]])/g,'\\$1')), 'i'),
+ pattern: RegExp(inlineLanguageRe.replace('{lang}', lang.replace(/([.+*?\/\\(){}\[\]])/g, '\\$1')), 'i'),
inside: Prism.util.clone(Prism.languages.pure['inline-lang'].inside)
};
o['inline-lang-' + alias].inside.rest = Prism.util.clone(Prism.languages[alias]);
diff --git a/components/prism-qsharp.js b/components/prism-qsharp.js
index 2e97ade..5544650 100644
--- a/components/prism-qsharp.js
+++ b/components/prism-qsharp.js
@@ -46,7 +46,7 @@
type: 'Adj BigInt Bool Ctl Double false Int One Pauli PauliI PauliX PauliY PauliZ Qubit Range Result String true Unit Zero',
// all other keywords
other: 'Adjoint adjoint apply as auto body borrow borrowing Controlled controlled distribute elif else fail fixup for function if in internal intrinsic invert is let mutable namespace new newtype open operation repeat return self set until use using while within'
- };
+ };
// keywords
function keywordsToPattern(words) {
return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b';
diff --git a/components/prism-renpy.js b/components/prism-renpy.js
index 125ed6b..49e26c6 100644
--- a/components/prism-renpy.js
+++ b/components/prism-renpy.js
@@ -1,4 +1,4 @@
-Prism.languages.renpy= {
+Prism.languages.renpy = {
// TODO Write tests.
'comment': {
@@ -11,21 +11,21 @@ Prism.languages.renpy= {
greedy: true
},
- 'function' : /[a-z_]\w*(?=\()/i,
+ 'function': /[a-z_]\w*(?=\()/i,
'property': /\b(?:insensitive|idle|hover|selected_idle|selected_hover|background|position|alt|xpos|ypos|pos|xanchor|yanchor|anchor|xalign|yalign|align|xcenter|ycenter|xofsset|yoffset|ymaximum|maximum|xmaximum|xminimum|yminimum|minimum|xsize|ysizexysize|xfill|yfill|area|antialias|black_color|bold|caret|color|first_indent|font|size|italic|justify|kerning|language|layout|line_leading|line_overlap_split|line_spacing|min_width|newline_indent|outlines|rest_indent|ruby_style|slow_cps|slow_cps_multiplier|strikethrough|text_align|underline|hyperlink_functions|vertical|hinting|foreground|left_margin|xmargin|top_margin|bottom_margin|ymargin|left_padding|right_padding|xpadding|top_padding|bottom_padding|ypadding|size_group|child|hover_sound|activate_sound|mouse|focus_mask|keyboard_focus|bar_vertical|bar_invert|bar_resizing|left_gutter|right_gutter|top_gutter|bottom_gutter|left_bar|right_bar|top_bar|bottom_bar|thumb|thumb_shadow|thumb_offset|unscrollable|spacing|first_spacing|box_reverse|box_wrap|order_reverse|fit_first|ysize|thumbnail_width|thumbnail_height|help|text_ypos|text_xpos|idle_color|hover_color|selected_idle_color|selected_hover_color|insensitive_color|alpha|insensitive_background|hover_background|zorder|value|width|xadjustment|xanchoraround|xaround|xinitial|xoffset|xzoom|yadjustment|yanchoraround|yaround|yinitial|yzoom|zoom|ground|height|text_style|text_y_fudge|selected_insensitive|has_sound|has_music|has_voice|focus|hovered|image_style|length|minwidth|mousewheel|offset|prefix|radius|range|right_margin|rotate|rotate_pad|developer|screen_width|screen_height|window_title|name|version|windows_icon|default_fullscreen|default_text_cps|default_afm_time|main_menu_music|sample_sound|enter_sound|exit_sound|save_directory|enter_transition|exit_transition|intra_transition|main_game_transition|game_main_transition|end_splash_transition|end_game_transition|after_load_transition|window_show_transition|window_hide_transition|adv_nvl_transition|nvl_adv_transition|enter_yesno_transition|exit_yesno_transition|enter_replay_transition|exit_replay_transition|say_attribute_transition|directory_name|executable_name|include_update|window_icon|modal|google_play_key|google_play_salt|drag_name|drag_handle|draggable|dragged|droppable|dropped|narrator_menu|action|default_afm_enable|version_name|version_tuple|inside|fadeout|fadein|layers|layer_clipping|linear|scrollbars|side_xpos|side_ypos|side_spacing|edgescroll|drag_joined|drag_raise|drop_shadow|drop_shadow_color|subpixel|easein|easeout|time|crop|auto|update|get_installed_packages|can_update|UpdateVersion|Update|overlay_functions|translations|window_left_padding|show_side_image|show_two_window)\b/,
'tag': /\b(?:label|image|menu|[hv]box|frame|text|imagemap|imagebutton|bar|vbar|screen|textbutton|buttoscreenn|fixed|grid|input|key|mousearea|side|timer|viewport|window|hotspot|hotbar|self|button|drag|draggroup|tag|mm_menu_frame|nvl|block|parallel)\b|\$/,
- 'keyword' : /\b(?:as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|yield|adjustment|alignaround|allow|angle|around|box_layout|cache|changed|child_size|clicked|clipping|corner1|corner2|default|delay|exclude|scope|slow|slow_abortable|slow_done|sound|style_group|substitute|suffix|transform_anchor|transpose|unhovered|config|theme|mm_root|gm_root|rounded_window|build|disabled_text|disabled|widget_selected|widget_text|widget_hover|widget|updater|behind|call|expression|hide|init|jump|onlayer|python|renpy|scene|set|show|transform|play|queue|stop|pause|define|window|repeat|contains|choice|on|function|event|animation|clockwise|counterclockwise|circles|knot|null|None|random|has|add|use|fade|dissolve|style|store|id|voice|center|left|right|less_rounded|music|movie|clear|persistent|ui)\b/,
+ 'keyword': /\b(?:as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|yield|adjustment|alignaround|allow|angle|around|box_layout|cache|changed|child_size|clicked|clipping|corner1|corner2|default|delay|exclude|scope|slow|slow_abortable|slow_done|sound|style_group|substitute|suffix|transform_anchor|transpose|unhovered|config|theme|mm_root|gm_root|rounded_window|build|disabled_text|disabled|widget_selected|widget_text|widget_hover|widget|updater|behind|call|expression|hide|init|jump|onlayer|python|renpy|scene|set|show|transform|play|queue|stop|pause|define|window|repeat|contains|choice|on|function|event|animation|clockwise|counterclockwise|circles|knot|null|None|random|has|add|use|fade|dissolve|style|store|id|voice|center|left|right|less_rounded|music|movie|clear|persistent|ui)\b/,
- 'boolean' : /\b(?:[Tt]rue|[Ff]alse)\b/,
+ 'boolean': /\b(?:[Tt]rue|[Ff]alse)\b/,
- 'number' : /(?:\b(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?)|\B\.\d+)(?:e[+-]?\d+)?j?/i,
+ 'number': /(?:\b(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?)|\B\.\d+)(?:e[+-]?\d+)?j?/i,
- 'operator' : /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at)\b/,
+ 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at)\b/,
- 'punctuation' : /[{}[\];(),.:]/
+ 'punctuation': /[{}[\];(),.:]/
};
Prism.languages.rpy = Prism.languages.renpy;
diff --git a/components/prism-sass.js b/components/prism-sass.js
index 4275888..9efe6db 100644
--- a/components/prism-sass.js
+++ b/components/prism-sass.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
Prism.languages.sass = Prism.languages.extend('css', {
// Sass comments don't need to be closed, only indented
'comment': {
diff --git a/components/prism-smarty.js b/components/prism-smarty.js
index 658f04d..7743004 100644
--- a/components/prism-smarty.js
+++ b/components/prism-smarty.js
@@ -3,7 +3,7 @@
Add support for {php}
*/
-(function(Prism) {
+(function (Prism) {
Prism.languages.smarty = {
'comment': /\{\*[\s\S]*?\*\}/,
@@ -56,7 +56,7 @@
};
// Tokenize all inline Smarty expressions
- Prism.hooks.add('before-tokenize', function(env) {
+ Prism.hooks.add('before-tokenize', function (env) {
var smartyPattern = /\{\*[\s\S]*?\*\}|\{[\s\S]+?\}/g;
var smartyLitteralStart = '{literal}';
var smartyLitteralEnd = '{/literal}';
@@ -64,12 +64,12 @@
Prism.languages['markup-templating'].buildPlaceholders(env, 'smarty', smartyPattern, function (match) {
// Smarty tags inside {literal} block are ignored
- if(match === smartyLitteralEnd) {
+ if (match === smartyLitteralEnd) {
smartyLitteralMode = false;
}
- if(!smartyLitteralMode) {
- if(match === smartyLitteralStart) {
+ if (!smartyLitteralMode) {
+ if (match === smartyLitteralStart) {
smartyLitteralMode = true;
}
@@ -80,7 +80,7 @@
});
// Re-insert the tokens after tokenizing
- Prism.hooks.add('after-tokenize', function(env) {
+ Prism.hooks.add('after-tokenize', function (env) {
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'smarty');
});
diff --git a/components/prism-solution-file.js b/components/prism-solution-file.js
index 76b0055..a00eac7 100644
--- a/components/prism-solution-file.js
+++ b/components/prism-solution-file.js
@@ -1,4 +1,4 @@
-(function (Prism){
+(function (Prism) {
var guid = {
// https://en.wikipedia.org/wiki/Universally_unique_identifier#Format
diff --git a/components/prism-tt2.js b/components/prism-tt2.js
index 236bd2d..b827acf 100644
--- a/components/prism-tt2.js
+++ b/components/prism-tt2.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
Prism.languages.tt2 = Prism.languages.extend('clike', {
'comment': /#.*|\[%#[\s\S]*?%\]/,
@@ -41,12 +41,12 @@
// The different types of TT2 strings "replace" the C-like standard string
delete Prism.languages.tt2.string;
- Prism.hooks.add('before-tokenize', function(env) {
+ Prism.hooks.add('before-tokenize', function (env) {
var tt2Pattern = /\[%[\s\S]+?%\]/g;
Prism.languages['markup-templating'].buildPlaceholders(env, 'tt2', tt2Pattern);
});
- Prism.hooks.add('after-tokenize', function(env) {
+ Prism.hooks.add('after-tokenize', function (env) {
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'tt2');
});
diff --git a/components/prism-typoscript.js b/components/prism-typoscript.js
index 16418f4..53cc223 100644
--- a/components/prism-typoscript.js
+++ b/components/prism-typoscript.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
var keywords = /\b(?:ACT|ACTIFSUB|CARRAY|CASE|CLEARGIF|COA|COA_INT|CONSTANTS|CONTENT|CUR|EDITPANEL|EFFECT|EXT|FILE|FLUIDTEMPLATE|FORM|FRAME|FRAMESET|GIFBUILDER|GMENU|GMENU_FOLDOUT|GMENU_LAYERS|GP|HMENU|HRULER|HTML|IENV|IFSUB|IMAGE|IMGMENU|IMGMENUITEM|IMGTEXT|IMG_RESOURCE|INCLUDE_TYPOSCRIPT|JSMENU|JSMENUITEM|LLL|LOAD_REGISTER|NO|PAGE|RECORDS|RESTORE_REGISTER|TEMPLATE|TEXT|TMENU|TMENUITEM|TMENU_LAYERS|USER|USER_INT|_GIFBUILDER|global|globalString|globalVar)\b/;
diff --git a/components/prism-v.js b/components/prism-v.js
index 4933340..e84095b 100644
--- a/components/prism-v.js
+++ b/components/prism-v.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
var interpolationExpr = {
pattern: /[\s\S]+/,
inside: null
@@ -44,7 +44,7 @@
});
interpolationExpr.inside = Prism.languages.v;
-
+
Prism.languages.insertBefore('v', 'operator', {
'attribute': {
pattern: /^\s*\[(?:deprecated|unsafe_fn|typedef|live|inline|flag|ref_only|windows_stdcall|direct_array_access)\]/m,
@@ -62,7 +62,7 @@
}
}
});
-
+
Prism.languages.insertBefore('v', 'function', {
'generic-function': {
// e.g. foo<T>( ...
diff --git a/components/prism-vala.js b/components/prism-vala.js
index 359d7af..41aa58e 100644
--- a/components/prism-vala.js
+++ b/components/prism-vala.js
@@ -41,7 +41,7 @@ Prism.languages.vala = Prism.languages.extend('clike', {
'constant': /\b[A-Z0-9_]+\b/
});
-Prism.languages.insertBefore('vala','string', {
+Prism.languages.insertBefore('vala', 'string', {
'raw-string': {
pattern: /"""[\s\S]*?"""/,
greedy: true,
diff --git a/components/prism-xeora.js b/components/prism-xeora.js
index fec952b..e3d8186 100644
--- a/components/prism-xeora.js
+++ b/components/prism-xeora.js
@@ -1,4 +1,4 @@
-(function(Prism) {
+(function (Prism) {
Prism.languages.xeora = Prism.languages.extend('markup', {
'constant': {
pattern: /\$(?:DomainContents|PageRenderDuration)\$/,
diff --git a/docs/prism-core.js.html b/docs/prism-core.js.html
index 229462b..24c4c9b 100644
--- a/docs/prism-core.js.html
+++ b/docs/prism-core.js.html
@@ -69,7 +69,7 @@ var _self = (typeof window !== 'undefined')
* @namespace
* @public
*/
-var Prism = (function (_self){
+var Prism = (function (_self) {
// Private helper vars
var lang = /\blang(?:uage)?-([\w-]+)\b/i;
@@ -460,7 +460,7 @@ var _ = {
root[inside] = ret;
// Update references in other language definitions
- _.languages.DFS(_.languages, function(key, value) {
+ _.languages.DFS(_.languages, function (key, value) {
if (value === old && key != inside) {
this[key] = ret;
}
@@ -508,7 +508,7 @@ var _ = {
* @memberof Prism
* @public
*/
- highlightAll: function(async, callback) {
+ highlightAll: function (async, callback) {
_.highlightAllUnder(document, async, callback);
},
@@ -527,7 +527,7 @@ var _ = {
* @memberof Prism
* @public
*/
- highlightAllUnder: function(container, async, callback) {
+ highlightAllUnder: function (container, async, callback) {
var env = {
callback: callback,
container: container,
@@ -573,7 +573,7 @@ var _ = {
* @memberof Prism
* @public
*/
- highlightElement: function(element, async, callback) {
+ highlightElement: function (element, async, callback) {
// Find language
var language = _.util.getLanguage(element);
var grammar = _.languages[language];
@@ -632,7 +632,7 @@ var _ = {
if (async && _self.Worker) {
var worker = new Worker(_.filename);
- worker.onmessage = function(evt) {
+ worker.onmessage = function (evt) {
insertHighlightedCode(evt.data);
};
@@ -702,7 +702,7 @@ var _ = {
* }
* });
*/
- tokenize: function(text, grammar) {
+ tokenize: function (text, grammar) {
var rest = grammar.rest;
if (rest) {
for (var token in rest) {
@@ -764,7 +764,7 @@ var _ = {
return;
}
- for (var i=0, callback; (callback = callbacks[i++]);) {
+ for (var i = 0, callback; (callback = callbacks[i++]);) {
callback(env);
}
}
diff --git a/plugins/autolinker/prism-autolinker.js b/plugins/autolinker/prism-autolinker.js
index 7658779..a3adfd0 100644
--- a/plugins/autolinker/prism-autolinker.js
+++ b/plugins/autolinker/prism-autolinker.js
@@ -1,4 +1,4 @@
-(function(){
+(function () {
if (typeof Prism === 'undefined') {
return;
@@ -44,11 +44,11 @@ Prism.plugins.autolinker = {
}
};
-Prism.hooks.add('before-highlight', function(env) {
+Prism.hooks.add('before-highlight', function (env) {
Prism.plugins.autolinker.processGrammar(env.grammar);
});
-Prism.hooks.add('wrap', function(env) {
+Prism.hooks.add('wrap', function (env) {
if (/-link$/.test(env.type)) {
env.tag = 'a';
@@ -69,7 +69,7 @@ Prism.hooks.add('wrap', function(env) {
// Silently catch any error thrown by decodeURIComponent (#1186)
try {
env.content = decodeURIComponent(env.content);
- } catch(e) { /* noop */ }
+ } catch (e) { /* noop */ }
}
});
diff --git a/plugins/copy-to-clipboard/prism-copy-to-clipboard.js b/plugins/copy-to-clipboard/prism-copy-to-clipboard.js
index 73bd06e..f6cac47 100644
--- a/plugins/copy-to-clipboard/prism-copy-to-clipboard.js
+++ b/plugins/copy-to-clipboard/prism-copy-to-clipboard.js
@@ -63,7 +63,7 @@
/** @param {CopyInfo} copyInfo */
function copyTextToClipboard(copyInfo) {
if (navigator.clipboard) {
- navigator.clipboard.writeText(copyInfo.getText()).then(copyInfo.success, function() {
+ navigator.clipboard.writeText(copyInfo.getText()).then(copyInfo.success, function () {
// try the fallback in case `writeText` didn't work
fallbackCopyTextToClipboard(copyInfo);
});
diff --git a/plugins/highlight-keywords/prism-highlight-keywords.js b/plugins/highlight-keywords/prism-highlight-keywords.js
index cb6b722..20351c2 100644
--- a/plugins/highlight-keywords/prism-highlight-keywords.js
+++ b/plugins/highlight-keywords/prism-highlight-keywords.js
@@ -1,10 +1,10 @@
-(function(){
+(function () {
if (typeof Prism === 'undefined') {
return;
}
-Prism.hooks.add('wrap', function(env) {
+Prism.hooks.add('wrap', function (env) {
if (env.type !== 'keyword') {
return;
}
diff --git a/plugins/keep-markup/prism-keep-markup.js b/plugins/keep-markup/prism-keep-markup.js
index ebb94d8..267d9d9 100644
--- a/plugins/keep-markup/prism-keep-markup.js
+++ b/plugins/keep-markup/prism-keep-markup.js
@@ -29,7 +29,7 @@
var child = elt.childNodes[i];
if (child.nodeType === 1) { // element
f(child);
- } else if(child.nodeType === 3) { // text
+ } else if (child.nodeType === 3) { // text
pos += child.data.length;
}
}
@@ -46,7 +46,7 @@
});
Prism.hooks.add('after-highlight', function (env) {
- if(env.keepMarkup && env.keepMarkup.length) {
+ if (env.keepMarkup && env.keepMarkup.length) {
var walk = function (elt, nodeState) {
for (var i = 0, l = elt.childNodes.length; i < l; i++) {
@@ -59,12 +59,12 @@
}
} else if (child.nodeType === 3) { // text
- if(!nodeState.nodeStart && nodeState.pos + child.data.length > nodeState.node.posOpen) {
+ if (!nodeState.nodeStart && nodeState.pos + child.data.length > nodeState.node.posOpen) {
// We found the start position
nodeState.nodeStart = child;
nodeState.nodeStartPos = nodeState.node.posOpen - nodeState.pos;
}
- if(nodeState.nodeStart && nodeState.pos + child.data.length >= nodeState.node.posClose) {
+ if (nodeState.nodeStart && nodeState.pos + child.data.length >= nodeState.node.posClose) {
// We found the end position
nodeState.nodeEnd = child;
nodeState.nodeEndPos = nodeState.node.posClose - nodeState.pos;
diff --git a/plugins/normalize-whitespace/prism-normalize-whitespace.js b/plugins/normalize-whitespace/prism-normalize-whitespace.js
index 5735d98..9d9a540 100644
--- a/plugins/normalize-whitespace/prism-normalize-whitespace.js
+++ b/plugins/normalize-whitespace/prism-normalize-whitespace.js
@@ -1,4 +1,4 @@
-(function() {
+(function () {
if (typeof Prism === 'undefined' || typeof document === 'undefined') {
return;
@@ -17,7 +17,7 @@ function NormalizeWhitespace(defaults) {
}
function toCamelCase(value) {
- return value.replace(/-(\w)/g, function(match, firstChar) {
+ return value.replace(/-(\w)/g, function (match, firstChar) {
return firstChar.toUpperCase();
});
}
@@ -79,7 +79,7 @@ NormalizeWhitespace.prototype = {
if (!indents || !indents[0].length)
return input;
- indents.sort(function(a, b){return a.length - b.length; });
+ indents.sort(function (a, b) { return a.length - b.length; });
if (!indents[0].length)
return input;
diff --git a/plugins/previewers/prism-previewers.js b/plugins/previewers/prism-previewers.js
index a385af1..abb9e4b 100644
--- a/plugins/previewers/prism-previewers.js
+++ b/plugins/previewers/prism-previewers.js
@@ -1,4 +1,4 @@
-(function() {
+(function () {
if (typeof Prism === 'undefined' || typeof document === 'undefined' || !Function.prototype.bind) {
return;
@@ -20,7 +20,7 @@
* @param {string} func Gradient function name ("linear-gradient")
* @param {string[]} values Array of the gradient function parameters (["0deg", "red 0%", "blue 100%"])
*/
- var convertToW3CLinearGradient = function(prefix, func, values) {
+ var convertToW3CLinearGradient = function (prefix, func, values) {
// Default value for angle
var angle = '180deg';
@@ -70,7 +70,7 @@
* @param {string} func Gradient function name ("linear-gradient")
* @param {string[]} values Array of the gradient function parameters (["0deg", "red 0%", "blue 100%"])
*/
- var convertToW3CRadialGradient = function(prefix, func, values) {
+ var convertToW3CRadialGradient = function (prefix, func, values) {
if (values[0].indexOf('at') < 0) {
// Looks like old syntax
@@ -113,7 +113,7 @@
*
* @param {string} gradient The CSS gradient
*/
- var convertToW3CGradient = function(gradient) {
+ var convertToW3CGradient = function (gradient) {
if (cache[gradient]) {
return cache[gradient];
}
@@ -134,7 +134,7 @@
};
return function () {
- new Prism.plugins.Previewer('gradient', function(value) {
+ new Prism.plugins.Previewer('gradient', function (value) {
this.firstChild.style.backgroundImage = '';
this.firstChild.style.backgroundImage = convertToW3CGradient(value);
return !!this.firstChild.style.backgroundImage;
@@ -188,7 +188,7 @@
},
'angle': {
create: function () {
- new Prism.plugins.Previewer('angle', function(value) {
+ new Prism.plugins.Previewer('angle', function (value) {
var num = parseFloat(value);
var unit = value.match(/[a-z]+$/i);
var max, percentage;
@@ -197,7 +197,7 @@
}
unit = unit[0];
- switch(unit) {
+ switch (unit) {
case 'deg':
max = 360;
break;
@@ -211,10 +211,10 @@
max = 1;
}
- percentage = 100 * num/max;
+ percentage = 100 * num / max;
percentage %= 100;
- this[(num < 0? 'set' : 'remove') + 'Attribute']('data-negative', '');
+ this[(num < 0 ? 'set' : 'remove') + 'Attribute']('data-negative', '');
this.querySelector('circle').style.strokeDasharray = Math.abs(percentage) + ',500';
return true;
}, '*', function () {
@@ -267,7 +267,7 @@
},
'color': {
create: function () {
- new Prism.plugins.Previewer('color', function(value) {
+ new Prism.plugins.Previewer('color', function (value) {
this.style.backgroundColor = '';
this.style.backgroundColor = value;
return !!this.style.backgroundColor;
@@ -325,13 +325,13 @@
'ease': '.25,.1,.25,1',
'ease-in': '.42,0,1,1',
'ease-out': '0,0,.58,1',
- 'ease-in-out':'.42,0,.58,1'
+ 'ease-in-out': '.42,0,.58,1'
}[value] || value;
var p = value.match(/-?(?:\d+(?:\.\d+)?|\.\d+)/g);
- if(p.length === 4) {
- p = p.map(function(p, i) { return (i % 2? 1 - p : p) * 100; });
+ if (p.length === 4) {
+ p = p.map(function (p, i) { return (i % 2 ? 1 - p : p) * 100; });
this.querySelector('path').setAttribute('d', 'M0,100 C' + p[0] + ',' + p[1] + ', ' + p[2] + ',' + p[3] + ', 100,0');
@@ -403,7 +403,7 @@
'time': {
create: function () {
- new Prism.plugins.Previewer('time', function(value) {
+ new Prism.plugins.Previewer('time', function (value) {
var num = parseFloat(value);
var unit = value.match(/[a-z]+$/i);
if (!num || !unit) {
@@ -539,7 +539,7 @@
this._elt = document.createElement('div');
this._elt.className = 'prism-previewer prism-previewer-' + this._type;
document.body.appendChild(this._elt);
- if(this.initializer) {
+ if (this.initializer) {
this.initializer();
}
};
@@ -554,7 +554,7 @@
var previewers = token.getAttribute('data-previewers');
return (previewers || '').split(/\s+/).indexOf(this._type) === -1;
}
- } while((token = token.parentNode));
+ } while ((token = token.parentNode));
return false;
};
@@ -571,7 +571,7 @@
if (token.classList && token.classList.contains(TOKEN_CLASS) && token.classList.contains(this._type)) {
break;
}
- } while((token = token.parentNode));
+ } while ((token = token.parentNode));
if (token && token !== this._token) {
this._token = token;
@@ -582,7 +582,7 @@
/**
* Called on mouseout
*/
- Previewer.prototype.mouseout = function() {
+ Previewer.prototype.mouseout = function () {
this._token.removeEventListener('mouseout', this._mouseout, false);
this._token = null;
this.hide();
@@ -691,7 +691,7 @@
Prism.languages.insertBefore(inside, before, previewers[previewer].tokens, root);
env.grammar = Prism.languages[lang];
- languages[env.language] = {initialized: true};
+ languages[env.language] = { initialized: true };
}
});
}
@@ -700,7 +700,7 @@
// Initialize the previewers only when needed
Prism.hooks.add('after-highlight', function (env) {
- if(Previewer.byLanguages['*'] || Previewer.byLanguages[env.language]) {
+ if (Previewer.byLanguages['*'] || Previewer.byLanguages[env.language]) {
Previewer.initEvents(env.element, env.language);
}
});
diff --git a/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js b/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js
index 5c49e42..5ceeab6 100644
--- a/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js
+++ b/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js
@@ -1,4 +1,4 @@
-(function() {
+(function () {
if (typeof Prism === 'undefined' || typeof document === 'undefined') {
return;
diff --git a/plugins/toolbar/prism-toolbar.js b/plugins/toolbar/prism-toolbar.js
index b6c1f02..23c678b 100644
--- a/plugins/toolbar/prism-toolbar.js
+++ b/plugins/toolbar/prism-toolbar.js
@@ -1,4 +1,4 @@
-(function(){
+(function () {
if (typeof Prism === 'undefined' || typeof document === 'undefined') {
return;
@@ -6,7 +6,7 @@
var callbacks = [];
var map = {};
- var noop = function() {};
+ var noop = function () {};
Prism.plugins.toolbar = {};
@@ -121,7 +121,7 @@
});
}
- elementCallbacks.forEach(function(callback) {
+ elementCallbacks.forEach(function (callback) {
var element = callback(env);
if (!element) {
@@ -139,7 +139,7 @@
wrapper.appendChild(toolbar);
};
- registerButton('label', function(env) {
+ registerButton('label', function (env) {
var pre = env.element.parentNode;
if (!pre || !/pre/i.test(pre.nodeName)) {
return;
diff --git a/plugins/wpd/prism-wpd.js b/plugins/wpd/prism-wpd.js
index 2fc318c..45a94c6 100644
--- a/plugins/wpd/prism-wpd.js
+++ b/plugins/wpd/prism-wpd.js
@@ -1,4 +1,4 @@
-(function(){
+(function () {
if (typeof Prism === 'undefined') {
return;
@@ -25,8 +25,8 @@ if (Prism.languages.markup) {
var Tags = {
HTML: {
- 'a': 1, 'abbr': 1, 'acronym': 1, 'b': 1, 'basefont': 1, 'bdo': 1, 'big': 1, 'blink': 1, 'cite': 1, 'code': 1, 'dfn': 1, 'em': 1, 'kbd': 1, 'i': 1,
- 'rp': 1, 'rt': 1, 'ruby': 1, 's': 1, 'samp': 1, 'small': 1, 'spacer': 1, 'strike': 1, 'strong': 1, 'sub': 1, 'sup': 1, 'time': 1, 'tt': 1, 'u': 1,
+ 'a': 1, 'abbr': 1, 'acronym': 1, 'b': 1, 'basefont': 1, 'bdo': 1, 'big': 1, 'blink': 1, 'cite': 1, 'code': 1, 'dfn': 1, 'em': 1, 'kbd': 1, 'i': 1,
+ 'rp': 1, 'rt': 1, 'ruby': 1, 's': 1, 'samp': 1, 'small': 1, 'spacer': 1, 'strike': 1, 'strong': 1, 'sub': 1, 'sup': 1, 'time': 1, 'tt': 1, 'u': 1,
'var': 1, 'wbr': 1, 'noframes': 1, 'summary': 1, 'command': 1, 'dt': 1, 'dd': 1, 'figure': 1, 'figcaption': 1, 'center': 1, 'section': 1, 'nav': 1,
'article': 1, 'aside': 1, 'hgroup': 1, 'header': 1, 'footer': 1, 'address': 1, 'noscript': 1, 'isIndex': 1, 'main': 1, 'mark': 1, 'marquee': 1,
'meter': 1, 'menu': 1
@@ -46,12 +46,12 @@ if (Prism.languages.markup) {
var language;
-Prism.hooks.add('wrap', function(env) {
+Prism.hooks.add('wrap', function (env) {
if ((env.type == 'tag-id'
|| (env.type == 'property' && env.content.indexOf('-') != 0)
- || (env.type == 'rule'&& env.content.indexOf('@-') != 0)
- || (env.type == 'pseudo-class'&& env.content.indexOf(':-') != 0)
- || (env.type == 'pseudo-element'&& env.content.indexOf('::-') != 0)
+ || (env.type == 'rule' && env.content.indexOf('@-') != 0)
+ || (env.type == 'pseudo-class' && env.content.indexOf(':-') != 0)
+ || (env.type == 'pseudo-element' && env.content.indexOf('::-') != 0)
|| (env.type == 'attr-name' && env.content.indexOf('data-') != 0)
) && env.content.indexOf('<') === -1
) {
diff --git a/prism.js b/prism.js
index 95fb799..772c7a6 100644
--- a/prism.js
+++ b/prism.js
@@ -21,7 +21,7 @@ var _self = (typeof window !== 'undefined')
* @namespace
* @public
*/
-var Prism = (function (_self){
+var Prism = (function (_self) {
// Private helper vars
var lang = /\blang(?:uage)?-([\w-]+)\b/i;
@@ -412,7 +412,7 @@ var _ = {
root[inside] = ret;
// Update references in other language definitions
- _.languages.DFS(_.languages, function(key, value) {
+ _.languages.DFS(_.languages, function (key, value) {
if (value === old && key != inside) {
this[key] = ret;
}
@@ -460,7 +460,7 @@ var _ = {
* @memberof Prism
* @public
*/
- highlightAll: function(async, callback) {
+ highlightAll: function (async, callback) {
_.highlightAllUnder(document, async, callback);
},
@@ -479,7 +479,7 @@ var _ = {
* @memberof Prism
* @public
*/
- highlightAllUnder: function(container, async, callback) {
+ highlightAllUnder: function (container, async, callback) {
var env = {
callback: callback,
container: container,
@@ -525,7 +525,7 @@ var _ = {
* @memberof Prism
* @public
*/
- highlightElement: function(element, async, callback) {
+ highlightElement: function (element, async, callback) {
// Find language
var language = _.util.getLanguage(element);
var grammar = _.languages[language];
@@ -584,7 +584,7 @@ var _ = {
if (async && _self.Worker) {
var worker = new Worker(_.filename);
- worker.onmessage = function(evt) {
+ worker.onmessage = function (evt) {
insertHighlightedCode(evt.data);
};
@@ -654,7 +654,7 @@ var _ = {
* }
* });
*/
- tokenize: function(text, grammar) {
+ tokenize: function (text, grammar) {
var rest = grammar.rest;
if (rest) {
for (var token in rest) {
@@ -716,7 +716,7 @@ var _ = {
return;
}
- for (var i=0, callback; (callback = callbacks[i++]);) {
+ for (var i = 0, callback; (callback = callbacks[i++]);) {
callback(env);
}
}
diff --git a/tests/pattern-tests.js b/tests/pattern-tests.js
index 7fa80ad..bf1ac4f 100644
--- a/tests/pattern-tests.js
+++ b/tests/pattern-tests.js
@@ -564,7 +564,7 @@ function testPatterns(Prism) {
case 'Self': {
rangeOffset = report.parentQuant.start + 1;
rangeStr = patternStr.substring(report.parentQuant.start + 1, report.parentQuant.end + 1);
- rangeHighlight = highlight([{...report.quant, label: 'self'}], -report.parentQuant.start);
+ rangeHighlight = highlight([{ ...report.quant, label: 'self' }], -report.parentQuant.start);
break;
}
case 'Move': {
diff --git a/tests/plugins/keep-markup/test.js b/tests/plugins/keep-markup/test.js
index bc98ef0..946d124 100644
--- a/tests/plugins/keep-markup/test.js
+++ b/tests/plugins/keep-markup/test.js
@@ -16,7 +16,7 @@ require('../../../plugins/keep-markup/prism-keep-markup');
describe('Prism Keep Markup Plugin', function () {
- function execute (code) {
+ function execute(code) {
const start = [];
const end = [];
const nodes = [];