smartLists: true,
smartypants: false
});
-
+ // A FEW HACKS!!?
+
+ text = text.replace(/\\\n/g,' ');
return Roo.Markdown.marked(text);
};
//
* Block Lexer
*/
- function Lexer(options) {
+ var Lexer = function (options) {
this.tokens = [];
this.tokens.links = {};
this.options = options || marked.defaults;
* Inline Lexer & Compiler
*/
- function InlineLexer(links, options) {
+ var InlineLexer = function (links, options) {
this.options = options || marked.defaults;
this.links = links;
this.rules = inline.normal;
* Renderer
*/
- function Renderer(options) {
+ var Renderer = function (options) {
this.options = options || {};
}
};
Renderer.prototype.table = function(header, body) {
- return '<table>\n'
+ return '<table class="table table-striped">\n'
+ '<thead>\n'
+ header
+ '</thead>\n'
* Parsing & Compiling
*/
- function Parser(options) {
+ var Parser = function (options) {
this.tokens = [];
this.token = null;
this.options = options || marked.defaults;
* Helpers
*/
- function escape(html, encode) {
+ var escape = function (html, encode) {
return html
.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&')
.replace(/</g, '<')
.replace(/'/g, ''');
}
- function unescape(html) {
+ var unescape = function (html) {
// explicitly match decimal, hex, and named HTML entities
return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) {
n = n.toLowerCase();
});
}
- function replace(regex, opt) {
+ var replace = function (regex, opt) {
regex = regex.source;
opt = opt || '';
return function self(name, val) {
};
}
- function noop() {}
+ var noop = function () {}
noop.exec = noop;
function merge(obj) {
* Marked
*/
- function marked(src, opt, callback) {
+ var marked = function (src, opt, callback) {
if (callback || typeof opt === 'function') {
if (!callback) {
callback = opt;
return --pending || done();
}
return highlight(token.text, token.lang, function(err, code) {
- if (err) return done(err);
+ if (err) { return done(err); }
if (code == null || code === token.text) {
return --pending || done();
}
return;
}
try {
- if (opt) opt = merge({}, marked.defaults, opt);
+ if (opt) { opt = merge({}, marked.defaults, opt); }
return Parser.parse(Lexer.lex(src, opt), opt);
} catch (e) {
e.message += '\nPlease report this to https://github.com/chjj/marked.';