Moving markdown parser function from syncscroll.js to extra.js
This commit is contained in:
parent
4e358cd6f4
commit
36451ddbe9
2 changed files with 7 additions and 8 deletions
|
@ -429,6 +429,13 @@ var md = new Remarkable('full', {
|
||||||
typographer: true,
|
typographer: true,
|
||||||
highlight: highlightRender
|
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 */ ) {
|
md.renderer.rules.list_item_open = function ( /* tokens, idx, options, env */ ) {
|
||||||
return '<li class="raw">';
|
return '<li class="raw">';
|
||||||
};
|
};
|
||||||
|
|
|
@ -78,14 +78,6 @@ md.renderer.rules.heading_open = function (tokens, idx) {
|
||||||
return '<h' + tokens[idx].hLevel + '>';
|
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) {
|
md.renderer.rules.fence = function (tokens, idx, options, env, self) {
|
||||||
var token = tokens[idx];
|
var token = tokens[idx];
|
||||||
var langClass = '';
|
var langClass = '';
|
||||||
|
|
Loading…
Reference in a new issue