marked/src/TextRenderer.js

32 lines
654 B
JavaScript
Raw Normal View History

/**
* marked - a markdown parser
* Copyright (c) 2011-2018, Christopher Jeffrey. (MIT Licensed)
* https://github.com/markedjs/marked
*/
/**
* TextRenderer
* returns only the textual part of the token
*/
export default function TextRenderer() {}
// no need for block level renderers
TextRenderer.prototype.strong =
TextRenderer.prototype.em =
TextRenderer.prototype.codespan =
TextRenderer.prototype.del =
TextRenderer.prototype.text = function(text) {
return text;
};
TextRenderer.prototype.link =
TextRenderer.prototype.image = function(href, title, text) {
return '' + text;
};
TextRenderer.prototype.br = function() {
return '';
};