PrismJS / prism

Lightweight, robust, elegant syntax highlighting.
https://prismjs.com
MIT License
12.28k stars 1.3k forks source link

Autolinker doesn't work with the bundled js #1022

Closed spooky closed 8 years ago

spooky commented 8 years ago

I used this configuration to download the js: http://prismjs.com/download.html?themes=prism-okaidia&languages=markup&plugins=line-numbers+autolinker

Autolinker doesn't work, but when I use the unminified & unbundled version (so include prism.js & prism-autolinker.js) it works fine.

sample code:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="prism.css" data-noprefix />
</head>
<body>
<section>
    <pre><code class="language-javascript">/**
 * Prism: Lightweight, robust, elegant syntax highlighting
 * MIT license http://www.opensource.org/licenses/mit-license.php/
 * @author Lea Verou http://lea.verou.me
 * Reach Lea at fake@email.com (no, not really)
 * And this is [a Markdown link](http://prismjs.com). Sweet, huh?
 */
var foo = 5;
// And a single line comment http://google.com</code></pre>
</section>
<script src="prism.js"></script>
<script src="prism-autolinker.js"></script>
</body>
</html>
Golmote commented 8 years ago

The link to the download page you provided does not have the JavaScript language included in the bundle.

The file prism.js on github is used by the Prism website, so it already has the JS language included. When you use the bundle generated by the download page however, you do need to check JavaScript to actually be able to highlight JS code.

spooky commented 8 years ago

Ok, thanks.