markdown-it-regexp icon indicating copy to clipboard operation
markdown-it-regexp copied to clipboard

Using the plugin twice with the same markdown-it instance

Open gldraphael opened this issue 7 years ago • 0 comments

I tried creating a second plugin with the following code:

var doubleSpaces = mdRegex(
  // two consecutive spaces
  /\s\s/,
  // replace with two nonbreaking spaces
  function(match, utils) { // This doesn't get called :/
    console.log('Two consecutive spaces found');
    return '  ';
  }
)

I use markdown-it as:

var md = require('markdown-it')()
  .use(chordPattern)
  .use(doubleSpaces);
var result = md.render(str);

However the function doesn't get called.

Here's my code with the issue: here.

gldraphael avatar Nov 20 '16 19:11 gldraphael