/*! Typographer - v0.1.0 - 2015-08-18 * https://github.com/sakharstudio/typographer * Copyright (c) 2015 Loginov Yura; Licensed MIT */ !function(a,b,c,d){function e(b,c){this.element=b,this.settings=a.extend({},g,c),this._defaults=g,this._name=f,this.init()}var f="typographer",g={prepositions:["в","во","без","до","из","к","ко","на","по","о","от","при","с","у","не","за","над","для","об","под","про","и","а","но","да","или","ли","бы","то","что","как","я","он","мы","они","ни","же","вы","им"],nbsp:" "};a.extend(e.prototype,{init:function(){this.addNbsp(this.element,this.settings)},addNbsp:function(b,c){var d=c.nbsp,e=c.prepositions.map(function(a){return" "+a+" "}),f=c.prepositions.map(function(a){return" "+a+" "}),g=new RegExp(e.join("|"),"gi"),h=new RegExp(f.join("|"),"gi"),i=function(a){return a.slice(0,-1)+d},j=a(b).html().replace(g,i).replace(h,i);a(b).html(j)}}),a.fn[f]=function(b){return this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))}),this}}(jQuery,window,document);