I just solved it using the powerful console.log(object_that_i_dont_know_how_its_made)
, but just with console.log(markdownIt.renderer.rules)
.
From that I assumed that the code from the demo plugin could be easily adapted to any of the renderer rules.
BTW the rule I used for the plugin I'm writing is text
:
...
plugin: function (markdownIt, _options) {
const defaultRender = markdownIt.renderer.rules.text || function (tokens, idx, options, env, self) {
return self.renderToken(tokens, idx, options, env, self);
};
markdownIt.renderer.rules.text = function (tokens, idx, options, env, self) {
const token = tokens[idx];
...
and instead of the token.info
, I used token.content
property.