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

Side by Side Diff: 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
(Empty)
1 <!--
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
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
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
8 -->
9
10 <link rel="import" href="../polymer/polymer.html">
11 <link rel="import" href="marked-import.html">
12
13 <!--
14 Element wrapper for the `marked` (http://marked.org/) library.
15
16 @class marked-element
17 @blurb Element wrapper for the marked library.
18 @status alpha
19 @snap snap.png
20 -->
21 <polymer-element name="marked-element" attributes="text">
22 <script>
23
24 Polymer('marked-element', {
25
26 text: '',
27
28 attached: function() {
29 marked.setOptions({
30 highlight: this.highlight.bind(this)
31 });
32 if (!this.text) {
33 this.text = this.innerHTML;
34 }
35 },
36
37 textChanged: function () {
38 this.innerHTML = marked(this.text);
39 },
40
41 highlight: function(code, lang) {
42 var event = this.fire('marked-js-highlight', {code: code, lang: lang});
43 return event.detail.code || code;
44 }
45
46 });
47
48 </script>
49 </polymer-element>
50
OLDNEW
« no previous file with comments | « bower_components/marked-element/index.html ('k') | bower_components/marked-element/marked-import.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698