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-markup.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.markup = { 1 Prism.languages.markup = {
2 'comment': /<!--[\w\W]*?-->/, 2 'comment': /<!--[\w\W]*?-->/,
3 'prolog': /<\?[\w\W]+?\?>/, 3 'prolog': /<\?[\w\W]+?\?>/,
4 'doctype': /<!DOCTYPE[\w\W]+?>/, 4 'doctype': /<!DOCTYPE[\w\W]+?>/,
5 'cdata': /<!\[CDATA\[[\w\W]*?]]>/i, 5 'cdata': /<!\[CDATA\[[\w\W]*?]]>/i,
6 'tag': { 6 'tag': {
7 » » pattern: /<\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(? !\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i, 7 » » pattern: /<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\? (?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,
8 inside: { 8 inside: {
9 'tag': { 9 'tag': {
10 pattern: /^<\/?[^\s>\/]+/i, 10 pattern: /^<\/?[^\s>\/]+/i,
11 inside: { 11 inside: {
12 'punctuation': /^<\/?/, 12 'punctuation': /^<\/?/,
13 'namespace': /^[^\s>\/:]+:/ 13 'namespace': /^[^\s>\/:]+:/
14 } 14 }
15 }, 15 },
16 'attr-value': { 16 'attr-value': {
17 pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i, 17 pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,
(...skipping 14 matching lines...) Expand all
32 'entity': /&#?[\da-z]{1,8};/i 32 'entity': /&#?[\da-z]{1,8};/i
33 }; 33 };
34 34
35 // Plugin to make entity title show the real entity, idea by Roman Komarov 35 // Plugin to make entity title show the real entity, idea by Roman Komarov
36 Prism.hooks.add('wrap', function(env) { 36 Prism.hooks.add('wrap', function(env) {
37 37
38 if (env.type === 'entity') { 38 if (env.type === 'entity') {
39 env.attributes['title'] = env.content.replace(/&amp;/, '&'); 39 env.attributes['title'] = env.content.replace(/&amp;/, '&');
40 } 40 }
41 }); 41 });
42
43 Prism.languages.xml = Prism.languages.markup;
44 Prism.languages.html = Prism.languages.markup;
45 Prism.languages.mathml = Prism.languages.markup;
46 Prism.languages.svg = Prism.languages.markup;
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-markdown.min.js ('k') | lib/src/prism/components/prism-markup.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698