mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Fix marked definitions and tests
This commit is contained in:
+8
-14
@@ -3,23 +3,17 @@
|
||||
import marked = module('marked');
|
||||
|
||||
marked.setOptions({
|
||||
gfm: true,
|
||||
tables: true,
|
||||
breaks: false,
|
||||
pedantic: false,
|
||||
sanitize: true,
|
||||
highlight: function(code, lang) {
|
||||
if (lang === 'js') {
|
||||
return highlighter.javascript(code);
|
||||
gfm: true,
|
||||
tables: true,
|
||||
breaks: false,
|
||||
pedantic: false,
|
||||
sanitize: true,
|
||||
highlight: function (code, lang) {
|
||||
}
|
||||
return code;
|
||||
}
|
||||
});
|
||||
console.log(marked('i am using __markdown__.'));
|
||||
|
||||
var text = 'something',
|
||||
options = {};
|
||||
var tokens = marked.lexer(text, options);
|
||||
console.log(marked.parser(tokens));
|
||||
|
||||
var lexer = new marked.Lexer(options);
|
||||
var tokens2 = lexer.lex(text);
|
||||
console.log(lexer.rules);
|
||||
Vendored
+3
-2
@@ -3,10 +3,11 @@
|
||||
// Definitions by: William Orr <https://github.com/worr>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
declare module "marked" {
|
||||
export function (src: string, opt?: Options): string;
|
||||
export function lexer(src: string, opt?: Options): Array;
|
||||
export function parser(src: string, opt?: Options): string;
|
||||
export function lexer(src: string, opt?: Options): any[];
|
||||
export function parser(src: any[], opt?: Options): string;
|
||||
export function parse(src: string, opt?: Options): string;
|
||||
export function setOptions(opt: Options): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user