mirror of https://github.com/status-im/codimd.git
Moving markdown parser function from syncscroll.js to extra.js
This commit is contained in:
parent
4e358cd6f4
commit
36451ddbe9
|
@ -429,6 +429,13 @@ var md = new Remarkable('full', {
|
|||
typographer: true,
|
||||
highlight: highlightRender
|
||||
});
|
||||
md.renderer.rules.image = function (tokens, idx, options /*, env */ ) {
|
||||
var src = ' src="' + Remarkable.utils.escapeHtml(tokens[idx].src) + '"';
|
||||
var title = tokens[idx].title ? (' title="' + Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(tokens[idx].title)) + '"') : '';
|
||||
var alt = ' alt="' + (tokens[idx].alt ? Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(tokens[idx].alt)) : '') + '"';
|
||||
var suffix = options.xhtmlOut ? ' /' : '';
|
||||
return '<img class="raw"' + src + alt + title + suffix + '>';
|
||||
}
|
||||
md.renderer.rules.list_item_open = function ( /* tokens, idx, options, env */ ) {
|
||||
return '<li class="raw">';
|
||||
};
|
||||
|
|
|
@ -78,14 +78,6 @@ md.renderer.rules.heading_open = function (tokens, idx) {
|
|||
return '<h' + tokens[idx].hLevel + '>';
|
||||
};
|
||||
|
||||
md.renderer.rules.image = function (tokens, idx, options /*, env */ ) {
|
||||
var src = ' src="' + Remarkable.utils.escapeHtml(tokens[idx].src) + '"';
|
||||
var title = tokens[idx].title ? (' title="' + Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(tokens[idx].title)) + '"') : '';
|
||||
var alt = ' alt="' + (tokens[idx].alt ? Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(tokens[idx].alt)) : '') + '"';
|
||||
var suffix = options.xhtmlOut ? ' /' : '';
|
||||
return '<img class="raw"' + src + alt + title + suffix + '>';
|
||||
}
|
||||
|
||||
md.renderer.rules.fence = function (tokens, idx, options, env, self) {
|
||||
var token = tokens[idx];
|
||||
var langClass = '';
|
||||
|
|
Loading…
Reference in New Issue