Félix Marty
add dana
3f268e5
raw
history blame
1.36 kB
"use strict";!function(e,t,r){var n=function(e,t){function r(r,n){for(var i=t.tokenize(r),a=[],s=0,o=0;o<i.length;o++){var p=i[o];if("nl"===p.type&&n.nl2br)a.push(e.createElement("br",{key:"linkified-"+ ++s}));else if(p.isLink&&n.check(p)){var f=n.resolve(p),l=(f.href,f.formatted),c=f.formattedHref,u=f.tagName,h=f.className,d=f.target,v=f.attributes,k=(f.events,{key:"linkified-"+ ++s,href:c});if(h&&(k.className=h),d&&(k.target=d),v)for(var m in v)k[m]=v[m];a.push(e.createElement(u,k,l))}else a.push(p.toString())}return a}function n(t,a){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0===e.Children.count(t.props.children))return t;var o=[];e.Children.forEach(t.props.children,function(t){"string"==typeof t?o.push.apply(o,r(t,a)):e.isValidElement(t)?"string"==typeof t.type&&i.contains(a.ignoreTags,t.type.toUpperCase())?o.push(t):o.push(n(t,a,++s)):o.push(t)});var p={key:"linkified-element-"+s};for(var f in t.props)p[f]=t.props[f];return e.cloneElement(t,p,o)}e="default"in e?e["default"]:e;var i=t.options,a=i.Options,s=e.createClass({render:function(){var t={key:"linkified-element-0"};for(var r in this.props)"options"!==r&&"tagName"!==r&&(t[r]=this.props[r]);var i=new a(this.props.options),s=this.props.tagName||"span",o=e.createElement(s,t);return n(o,i,0)}});return s}(t,r);e.Linkify=e.LinkifyReact=n}(window,React,linkify);