showdownjs / prettify-extension Goto Github PK
View Code? Open in Web Editor NEWPrettify extension for Showdown.js
License: BSD 2-Clause "Simplified" License
Prettify extension for Showdown.js
License: BSD 2-Clause "Simplified" License
Do these files come from dist
folder or src
one? Thanks.
<script src="showdown.min.js">
<script src="showdown-prettify.min.js">
Hi. I am trying to load the showdown-prettify extension from node + DOMJS. Using requires or whatever, but not from script tags in HTML. I have no idea how to do it.
An example would be welcome. (Even if the package is not used much, it is a dependency of the drawthe.net github repo, which allows to take YAML descriptions of network topologies and render them as SVG.)
DEPRECATION WARNING: prettify is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!
I got this warning in the latest version of Chrome.
DEPRECATION WARNING: prettify is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!
Moved from showdownjs/showdown#49
Hello,
I try to use prettify-extension with ng-showdown but without any success I believe. I'm not 100% sure this is a bug.
I start by adding Prettify as an extension to showdown :
$showdownProvider.loadExtension('prettify');
Then I use directive :
<p markdown-to-html="postCtrl.markdown"></p>
Result in plain html :
<pre class="prettyprint linenums">
<code class="language-javascript">var gulp = require('gulp');
gulp.task('default', function(){
console.log()
});
</code></pre>
All js and css are loaded properly.
Hi, we are getting this warning:
DEPRECATION WARNING: prettify is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!
And it origins here. Can you please update this extension so it uses the new loader method?
Thanks!
index.html
<!DOCTYPE html>
<html>
<head>
<title>index</title>
<meta charset="UTF-8"/>
<script src="./js/showdown.min.js"></script>
<script src="./js/showdown-prettify.min.js"></script>
<script src="./js/main.js"></script>
</head>
<body>
</body>
</html>
main.js
showdown.setFlavor('github');
var converter = new showdown.Converter({extensions: ['prettify']});
var input = "```js\n" +
"function add(a, b) { console.log(); }\n" +
"```";
var html = converter.makeHtml(input);
console.log(html);
output
<pre class="prettyprint linenums"><code class="js language-js">function add(a, b) { console.log(); }</code></pre>
I get the following error:
Uncaught Error: Extension "prettify" could not be loaded. It was either not found or is not a valid extension.
I load it as stated in the docs:
var converter = new Converter({extensions: ['prettify']});
I wonder if anyone is still actively using this extension. npm suggest that there are barely 100 weekly downloads for this extension, whereas showdowjs itself has over 300k per week. Is there some other way of "prettifying" the code without using this extension that people tend to prefer?
Hi, thanks for this plugin. It seems working well.
I have the string:
<a href="#">link</a>
That converts the follow html:
<pre class="prettyprint linenums">
<code class="html language-html"><a href="#">link</a></code>
</pre>
However, there's no syntax highlighter in here. Do I need to include any css?
PS: If I include the run_prettify.js
it works. It supposed to be it?
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.