@elliemae/ds-wysiwygeditor
Version:
Ellie Mae - Dim Sum - WYSIWYG Editor
46 lines (34 loc) • 2.03 kB
JavaScript
import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';
import _createClass from '@babel/runtime/helpers/esm/createClass';
import _get from '@babel/runtime/helpers/esm/get';
import _inherits from '@babel/runtime/helpers/esm/inherits';
import _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';
import _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';
import { Quill } from 'react-quill';
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var Link = Quill.import('formats/link');
var LinkFormat = /*#__PURE__*/function (_Link) {
_inherits(LinkFormat, _Link);
var _super = _createSuper(LinkFormat);
function LinkFormat() {
_classCallCheck(this, LinkFormat);
return _super.apply(this, arguments);
}
_createClass(LinkFormat, null, [{
key: "create",
value: function create(value) {
if (!value.startsWith('https')) {
if (!value.startsWith('www')) {
value = "https://www.".concat(value);
} else value = "https://".concat(value);
}
var node = _get(_getPrototypeOf(LinkFormat), "create", this).call(this, value);
node.setAttribute('href', value);
return node;
}
}]);
return LinkFormat;
}(Link);
export default LinkFormat;
//# sourceMappingURL=LinkFormat.js.map