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

Side by Side Diff: polymer_0.5.0/bower_components/marked-element/marked-element.html

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 months 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 <!-- 1 <!--
2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE.txt 3 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS.txt 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS.txt
6 Code distributed by Google as part of the polymer project is also 6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS.txt 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS.txt
8 --> 8 -->
9 9
10 <link rel="import" href="../polymer/polymer.html"> 10 <link rel="import" href="../polymer/polymer.html">
(...skipping 16 matching lines...) Expand all
27 27
28 attached: function() { 28 attached: function() {
29 marked.setOptions({ 29 marked.setOptions({
30 highlight: this.highlight.bind(this) 30 highlight: this.highlight.bind(this)
31 }); 31 });
32 if (!this.text) { 32 if (!this.text) {
33 this.text = this.innerHTML; 33 this.text = this.innerHTML;
34 } 34 }
35 }, 35 },
36 36
37 textChanged: function () { 37 textChanged: function (oldVal, newVal) {
38 this.innerHTML = marked(this.text); 38 if (newVal) {
39 this.innerHTML = marked(this.text);
40 }
39 }, 41 },
40 42
41 highlight: function(code, lang) { 43 highlight: function(code, lang) {
42 var event = this.fire('marked-js-highlight', {code: code, lang: lang}); 44 var event = this.fire('marked-js-highlight', {code: code, lang: lang});
43 return event.detail.code || code; 45 return event.detail.code || code;
44 } 46 }
45 47
46 }); 48 });
47 49
48 </script> 50 </script>
49 </polymer-element> 51 </polymer-element>
50 52
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698