Skip to content

Commit

Permalink
Added some language aliases.
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Sep 3, 2015
1 parent 29e26dc commit 2f9fe1e
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 5 deletions.
2 changes: 2 additions & 0 deletions components/prism-javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ if (Prism.languages.markup) {
}
});
}

Prism.languages.js = Prism.languages.javascript;
2 changes: 1 addition & 1 deletion components/prism-javascript.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions components/prism-markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ Prism.hooks.add('wrap', function(env) {
env.attributes['title'] = env.content.replace(/&/, '&');
}
});

Prism.languages.xml = Prism.languages.markup;
Prism.languages.html = Prism.languages.markup;
Prism.languages.mathml = Prism.languages.markup;
Prism.languages.svg = Prism.languages.markup;
2 changes: 1 addition & 1 deletion components/prism-markup.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
#examples h3 {
margin: 1em 0 0.3em;
}

ul {
padding-left: 40px;
}
</style>
<script src="prefixfree.min.js"></script>

Expand Down
6 changes: 5 additions & 1 deletion examples/prism-javascript.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<h1>JavaScript</h1>
<p>To use this language, use the class "language-javascript".</p>
<p>To use this language, use one of the following classes:</p>
<ul>
<li>"language-javascript"</li>
<li>"language-js"</li>
</ul>

<h2>Variable assignment</h2>
<pre><code>var foo = "bar", baz = 5;</code></pre>
Expand Down
9 changes: 8 additions & 1 deletion examples/prism-markup.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<h1>Markup</h1>
<p>To use this language, use the class "language-markup".</p>
<p>To use this language, use one of the following classes:</p>
<ul>
<li>"language-markup"</li>
<li>"language-xml"</li>
<li>"language-html"</li>
<li>"language-mathml"</li>
<li>"language-svg"</li>
</ul>

<h2>Empty tag</h2>
<pre><code>&lt;p>&lt;/p></code></pre>
Expand Down
6 changes: 6 additions & 0 deletions prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,11 @@ Prism.hooks.add('wrap', function(env) {
}
});

Prism.languages.xml = Prism.languages.markup;
Prism.languages.html = Prism.languages.markup;
Prism.languages.mathml = Prism.languages.markup;
Prism.languages.svg = Prism.languages.markup;


/* **********************************************
Begin prism-css.js
Expand Down Expand Up @@ -628,6 +633,7 @@ if (Prism.languages.markup) {
});
}

Prism.languages.js = Prism.languages.javascript;

/* **********************************************
Begin prism-file-highlight.js
Expand Down

0 comments on commit 2f9fe1e

Please sign in to comment.