Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Commit 9466702

Browse files
naesten's patches to README.html and to allow dotted language extensions publicly.
1 parent 6668102 commit 9466702

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

README.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h2>Setup</h2>
2828
<pre class="prettyprint">
2929
&lt;link href="prettify.css" type="text/css" rel="stylesheet" /&gt;
3030
&lt;script type="text/javascript" src="prettify.js"&gt;&lt;/script&gt;</pre>
31-
<li>Add <code class="prettyprint lang-html">onload="prettyPrint()"</code> to your
31+
<li>Add <code class="prettyprint lang-in.tag">onload="prettyPrint()"</code> to your
3232
document's body tag.
3333
<li>Modify the stylesheet to get the coloring you prefer</li>
3434
</ol>
@@ -63,7 +63,7 @@ <h2>Usage</h2>
6363
</table>
6464

6565
<h2>FAQ</h2>
66-
<h3 id="langs">Which languages does it work for?</h3>
66+
<h3 id="langs">For which languages does it work?</h3>
6767
<p>The comments in <tt>prettify.js</tt> are authoritative but the lexer
6868
should work on a number of languages including C and friends,
6969
Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles.
@@ -75,10 +75,10 @@ <h3 id="langs">Which languages does it work for?</h3>
7575
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-lisp.js"
7676
><code>lang-lisp.js</code></a>.</p>
7777
<p>And similarly for
78-
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-css.js"
79-
><code>CSS</code></a>,
8078
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-clj.js"
8179
><code>Clojure</code></a>,
80+
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-css.js"
81+
><code>CSS</code></a>,
8282
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-go.js"
8383
><code>Go</code></a>,
8484
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-hs.js"
@@ -87,18 +87,24 @@ <h3 id="langs">Which languages does it work for?</h3>
8787
><code>Lua</code></a>,
8888
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-ml.js"
8989
><code>OCAML, SML, F#</code></a>,
90+
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-n.js"
91+
><code>Nemerle</code></a>,
9092
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-proto.js"
9193
><code>Protocol Buffers</code></a>,
9294
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-scala.js"
9395
><code>Scala</code></a>,
9496
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-sql.js"
9597
><code>SQL</code></a>,
98+
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-tex.js"
99+
><code>TeX, LaTeX</code></a>,
96100
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-vhdl.js"
97101
><code>VHDL</code></a>,
98102
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-vb.js"
99103
><code>Visual Basic</code></a>,
100104
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-wiki.js"
101-
><code>WikiText</code></a>, and
105+
><code>WikiText</code></a>,
106+
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-xq.js"
107+
><code>XQuery</code></a>, and
102108
<a href="http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-yaml.js"
103109
><code>YAML</code></a>.
104110

@@ -107,7 +113,7 @@ <h3 id="langs">Which languages does it work for?</h3>
107113
<a href="http://code.google.com/p/google-code-prettify/issues/list"
108114
>issue</a> including your language extension, and a testcase.</p>
109115

110-
<h3>How do I specify which language my code is in?</h3>
116+
<h3>How do I specify the language of my code?</h3>
111117
<p>You don't need to specify the language since <code>prettyprint()</code>
112118
will guess. You can specify a language by specifying the language extension
113119
along with the <code>prettyprint</code> class like so:</p>
@@ -215,7 +221,7 @@ <h3>How can I customize the colors and styles of my code?</h3>
215221

216222
<div class="footer">
217223
<!-- Created: Tue Oct 3 17:51:56 PDT 2006 -->
218-
<!-- hhmts start -->Last modified: Fri May 20 12:43:46 PDT 2011 <!-- hhmts end -->
224+
<!-- hhmts start -->Last modified: Fri May 27 16:05:12 PDT 2011 <!-- hhmts end -->
219225
</div>
220226
</body>
221227
</html>

js-modules/prettify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ window['PR']
756756
// <pre class="prettyprint lang-cpp">
757757
// the language extension "cpp" is used to find a language handler as
758758
// passed to PR.registerLangHandler.
759-
var langExtension = cs.className.match(/\blang-(\w+)\b/);
759+
var langExtension = cs.className.match(/\blang-([\w.]+)(?!\S)/);
760760
if (langExtension) { langExtension = langExtension[1]; }
761761

762762
// make sure this is not nested in an already prettified element

src/prettify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ window['PR']
13321332
// <pre class="prettyprint lang-cpp">
13331333
// the language extension "cpp" is used to find a language handler as
13341334
// passed to PR.registerLangHandler.
1335-
var langExtension = cs.className.match(/\blang-(\w+)\b/);
1335+
var langExtension = cs.className.match(/\blang-([\w.]+)\b/);
13361336
if (langExtension) { langExtension = langExtension[1]; }
13371337

13381338
// make sure this is not nested in an already prettified element

0 commit comments

Comments
 (0)