Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: lib/src/prism/components/prism-latex.js

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 Prism.languages.latex = { 1 (function(Prism) {
2 » 'comment': /%.*?(\r?\n|$)$/m, 2 » var funcPattern = /\\([^a-z()[\]]|[a-z\*]+)/i,
3 » 'string': /(\$)(\\?.)*?\1/, 3 » insideEqu = {
4 » 'punctuation': /[{}]/, 4 » » 'equation-command': {
5 » 'selector': /\\[a-z;,:\.]*/i 5 » » » pattern: funcPattern,
6 }; 6 » » » alias: 'regex'
7 » » }
8 » };
9
10 » Prism.languages.latex = {
11 » » 'comment': /%.*/m,
12 » » // the verbatim environment prints whitespace to the document
13 » » 'cdata': {
14 » » » pattern: /(\\begin\{((?:verbatim|lstlisting)\*?)\})([\w\ W]*?)(?=\\end\{\2\})/,
15 » » » lookbehind: true
16 » » },
17 » » /*
18 » » * equations can be between $ $ or \( \) or \[ \]
19 » » * (all are multiline)
20 » » */
21 » » 'equation': [
22 » » » {
23 » » » » pattern: /\$(?:\\?[\w\W])*?\$|\\\((?:\\?[\w\W])* ?\\\)|\\\[(?:\\?[\w\W])*?\\\]/,
24 » » » » inside: insideEqu,
25 » » » » alias: 'string'
26 » » » },
27 » » » {
28 » » » » pattern: /(\\begin\{((?:equation|math|eqnarray|a lign|multline|gather)\*?)\})([\w\W]*?)(?=\\end\{\2\})/,
29 » » » » lookbehind: true,
30 » » » » inside: insideEqu,
31 » » » » alias: 'string'
32 » » » }
33 » » ],
34 » » /*
35 » » * arguments which are keywords or references are highlighted
36 » » * as keywords
37 » » */
38 » » 'keyword': {
39 » » » pattern: /(\\(?:begin|end|ref|cite|label|usepackage|docu mentclass)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
40 » » » lookbehind: true
41 » » },
42 » » 'url': {
43 » » » pattern: /(\\url\{)[^}]+(?=\})/,
44 » » » lookbehind: true
45 » » },
46 » » /*
47 » » * section or chapter headlines are highlighted as bold so that
48 » » * they stand out more
49 » » */
50 » » 'headline': {
51 » » » pattern: /(\\(?:part|chapter|section|subsection|frametit le|subsubsection|paragraph|subparagraph|subsubparagraph|subsubsubparagraph)\*?(? :\[[^\]]+\])?\{)[^}]+(?=\}(?:\[[^\]]+\])?)/,
52 » » » lookbehind: true,
53 » » » alias: 'class-name'
54 » » },
55 » » 'function': {
56 » » » pattern: funcPattern,
57 » » » alias: 'selector'
58 » » },
59 » » 'punctuation': /[[\]{}&]/
60 » };
61 })(Prism);
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-keyman.min.js ('k') | lib/src/prism/components/prism-latex.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698