Showing the changes to assets/javascripts (1 of 4 files). Show all
Unified · Split
| @@ -1,4 +1,4 @@ | ||
| 1 | −/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+c+cpp+coffeescript+ruby+d+elixir+erlang+go+java+json+kotlin+lua+nginx+nim+perl+php+python+crystal+rust+scss+sql+typescript */ | |
| 1 | +/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+c+cpp+coffeescript+ruby+d+elixir+erlang+go+java+json+kotlin+lua+nginx+nim+perl+php+python+jsx+crystal+rust+scss+sql+typescript */ | |
| 2 | 2 | var _self = (typeof window !== 'undefined') |
| 3 | 3 | ? window // if in browser |
| 4 | 4 | : ( |
| @@ -1681,6 +1681,44 @@ Prism.languages.python= { · 1676 unmodified lines | ||
| 1681 | 1681 | 'punctuation' : /[{}[\];(),.:]/ |
| 1682 | 1682 | }; |
| 1683 | 1683 | |
| 1684 | +(function(Prism) { | |
| 1685 | + | |
| 1686 | +var javascript = Prism.util.clone(Prism.languages.javascript); | |
| 1687 | + | |
| 1688 | +Prism.languages.jsx = Prism.languages.extend('markup', javascript); | |
| 1689 | +Prism.languages.jsx.tag.pattern= /<\/?[\w\.:-]+\s*(?:\s+(?:[\w\.:-]+(?:=(?:("|')(\\?[\s\S])*?\1|[^\s'">=]+|(\{[\s\S]*?\})))?|\{\.{3}\w+\}))*\s*\/?>/i; | |
| 1690 | + | |
| 1691 | +Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:('|")[\s\S]*?(\1)|[^\s>]+)/i; | |
| 1692 | + | |
| 1693 | +Prism.languages.insertBefore('inside', 'attr-name', { | |
| 1694 | + 'spread': { | |
| 1695 | + pattern: /\{\.{3}\w+\}/, | |
| 1696 | + inside: { | |
| 1697 | + 'punctuation': /\{|\}|\./, | |
| 1698 | + 'attr-value': /\w+/ | |
| 1699 | + } | |
| 1700 | + } | |
| 1701 | +}, Prism.languages.jsx.tag); | |
| 1702 | + | |
| 1703 | +var jsxExpression = Prism.util.clone(Prism.languages.jsx); | |
| 1704 | + | |
| 1705 | +delete jsxExpression.punctuation | |
| 1706 | + | |
| 1707 | +jsxExpression = Prism.languages.insertBefore('jsx', 'operator', { | |
| 1708 | + 'punctuation': /=(?={)|[{}[\];(),.:]/ | |
| 1709 | +}, { jsx: jsxExpression }); | |
| 1710 | + | |
| 1711 | +Prism.languages.insertBefore('inside', 'attr-value',{ | |
| 1712 | + 'script': { | |
| 1713 | + // Allow for one level of nesting | |
| 1714 | + pattern: /=(\{(?:\{[^}]*\}|[^}])+\})/i, | |
| 1715 | + inside: jsxExpression, | |
| 1716 | + 'alias': 'language-javascript' | |
| 1717 | + } | |
| 1718 | +}, Prism.languages.jsx.tag); | |
| 1719 | + | |
| 1720 | +}(Prism)); | |
| 1721 | + | |
| 1684 | 1722 | (function(Prism) { |
| 1685 | 1723 | Prism.languages.crystal = Prism.languages.extend('ruby', { |
| 1686 | 1724 | keyword: [ |