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

Side by Side Diff: bower_components/google-code-prettify/examples/quine.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 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8" />
5 <title>Making Quines Prettier</title>
6 <!-- The defer is not necessary for autoloading, but is necessary for the
7 script at the bottom to work as a Quine. -->
8 <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify .js?autoload=true&amp;skin=sunburst&amp;lang=css" defer="defer"></script>
9 <style>.operative { font-weight: bold; border:1px solid yellow }</style>
10 </head>
11
12 <body>
13 <h1>Making Quines Prettier</h1>
14
15 <p>
16 Below is the content of this page prettified. The <code>&lt;pre&gt;</code>
17 element is prettified because it has <code>class="prettyprint"</code> and
18 because the sourced script loads a JavaScript library that styles source
19 code.
20 </p>
21
22 <p>
23 The line numbers to the left appear because the preceding comment
24 <code>&lt;?prettify lang=html linenums=true?&gt;</code> turns on
25 line-numbering and the
26 <a href="http://google-code-prettify.googlecode.com/svn/trunk/styles/index.html" >stylesheet</a>
27 (see <code>skin=sunburst</code> in the <code>&lt;script src&gt;</code>)
28 specifies that every fifth line should be numbered.
29 </p>
30
31 <!-- Language hints can be put in XML application directive style comments. -->
32 <?prettify lang=html linenums=true?>
33 <pre class="prettyprint" id="quine" style="border:4px solid #88c"></pre>
34
35 <script>//<![CDATA[
36 (function () {
37 function html(s) {
38 return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
39 }
40
41 var quineHtml = html(
42 '<!DOCTYPE html>\n<html>\n'
43 + document.documentElement.innerHTML
44 + '\n<\/html>\n');
45
46 // Highlight the operative parts:
47 quineHtml = quineHtml.replace(
48 /&lt;script src[\s\S]*?&gt;&lt;\/script&gt;|&lt;!--\?[\s\S]*?--&gt;|&lt;pre\ b[\s\S]*?&lt;\/pre&gt;/g,
49 '<span class="operative">$&</span>');
50
51 document.getElementById("quine").innerHTML = quineHtml;
52 })();
53 //]]>
54 </script></body>
55 </html>
OLDNEW
« no previous file with comments | « bower_components/google-code-prettify/bower.json ('k') | bower_components/google-code-prettify/src/lang-apollo.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698