Skip to content

Commit

Permalink
Merge pull request #1 from shifteee/master
Browse files Browse the repository at this point in the history
pull changes
  • Loading branch information
shifteee authored Oct 19, 2017
2 parents 8465cd2 + fd8b80a commit fb301e5
Show file tree
Hide file tree
Showing 4 changed files with 951 additions and 13 deletions.
16 changes: 6 additions & 10 deletions lib/filters/typograf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ const Typographer = require('typograf');
const BaseFilter = require('./baseFilter');

class TgFilter extends BaseFilter {
constructor(options) {
super(options);

init() {
const locale = this.options.locale === 'ru' ? 'ru' : 'common';
const tg = this.tg = new Typographer({ locale });

if (this.options.disabled) {
tg.disableRule(this.options.disabled);
}
this.options.locale = options.locale === 'ru' ? 'ru' : 'common';
}

if (this.options.enabled) {
tg.enableRule(this.options.enabled);
}
init() {
this.tg = new Typographer(this.options);
}

_apply(text) {
Expand Down
Loading

0 comments on commit fb301e5

Please sign in to comment.