bluewings/pug-as-jsx-loader

Custom filters

Closed this issue · 0 comments

Hi, there is a way to use custom filters?

Example from PUG docs

options.filters = {
  'my-own-filter': function (text, options) {
    if (options.addStart) text = 'Start\n' + text;
    if (options.addEnd)   text = text + '\nEnd';
    return text;
  }
};
p
  :my-own-filter(addStart addEnd)
    Filter
    Body

It will produce

<p>
  Start
  Filter
  Body
  End
</p>

Thank you!