mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-03 12:00:40 +08:00
Added Showdown 0.3.1 definitions
This commit is contained in:
1 parent
0031a67d84
commit
dffdca514e
3 files changed
+107
No files matched your search
@@ -0,0 +1,20 @@
|
||||
/// <reference path="showdown.d.ts" />
|
||||
|
||||
// compile: tsc showdown/showdown-tests.ts --noImplicitAny --module commonjs
|
||||
// run: node showdown/showdown-tests.js
|
||||
|
||||
import Showdown = require('showdown');
|
||||
|
||||
var exampleMarkdown = '#hello, markdown',
|
||||
converter = new Showdown.converter(),
|
||||
preloadedExtensions = [ 'github', 'twitter', 'prettify', 'table' ],
|
||||
extensionsConverter = new Showdown.converter({ extensions: preloadedExtensions });
|
||||
|
||||
console.log(converter.makeHtml(exampleMarkdown));
|
||||
// should log '<h1 id="hellomarkdown">hello, markdown</h1>'
|
||||
|
||||
console.log(extensionsConverter.makeHtml(exampleMarkdown));
|
||||
// should log '<p><a href="http://twitter.com/search/%23hello">#hello</a>, markdown</p>'
|
||||
|
||||
Showdown.forEach(preloadedExtensions, console.log);
|
||||
// should log each item in the above array
|
||||
Reference in new issue
Block a user