blessed-contrib
Advanced tools
Comparing version 4.8.14 to 4.8.15
@@ -355,2 +355,8 @@ import * as Blessed from 'blessed' | ||
export interface MarkdownOptions extends CanvasOptions { | ||
/** | ||
* Markdown text to render. | ||
*/ | ||
markdown?: string; | ||
markdownStyle?: any; | ||
} | ||
@@ -357,0 +363,0 @@ |
@@ -16,6 +16,10 @@ "use strict"; | ||
this.evalStyles(options); | ||
const markdownOptions = { | ||
style: options.markdownStyle | ||
}; | ||
this.setOptions(options.style); | ||
this.evalStyles(markdownOptions); | ||
this.setOptions(markdownOptions.style); | ||
this.options = options; | ||
@@ -29,2 +33,6 @@ Box.call(this, options); | ||
Markdown.prototype.setMarkdown = function(str) { | ||
this.setContent(marked(str)); | ||
}; | ||
Markdown.prototype.setOptions = function(style) { | ||
@@ -34,13 +42,6 @@ marked.setOptions({ | ||
}); | ||
}; | ||
} | ||
Markdown.prototype.setMarkdown = function(str) { | ||
this.setContent(marked(str)); | ||
} | ||
Markdown.prototype.evalStyles = function(options) { | ||
if (!options.style) return; | ||
for (var st in options.style) { | ||
@@ -54,12 +55,11 @@ if (typeof(options.style[st])!="string") continue; | ||
} | ||
} | ||
}; | ||
} | ||
Markdown.prototype.getOptionsPrototype = function() { | ||
return { | ||
markdown: 'string' | ||
markdown: 'string', | ||
markdownStyle: 'object' | ||
} | ||
} | ||
}; | ||
@@ -66,0 +66,0 @@ Markdown.prototype.type = 'markdown'; |
{ | ||
"name": "blessed-contrib", | ||
"version": "4.8.14", | ||
"version": "4.8.15", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
101193
2277