medium-editor
Advanced tools
Comparing version 5.22.1 to 5.22.2
{ | ||
"name": "medium-editor", | ||
"version": "5.22.1", | ||
"version": "5.22.2", | ||
"author": "Davi Ferreira <hi@daviferreira.com>", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -55,11 +55,13 @@ (function () { | ||
targets = MediumEditor.util.isElement(targets) || [win, doc].indexOf(targets) > -1 ? [targets] : targets; | ||
if (targets !== null) { | ||
targets = MediumEditor.util.isElement(targets) || [win, doc].indexOf(targets) > -1 ? [targets] : targets; | ||
Array.prototype.forEach.call(targets, function (target) { | ||
index = this.indexOfListener(target, event, listener, useCapture); | ||
if (index !== -1) { | ||
e = this.events.splice(index, 1)[0]; | ||
e[0].removeEventListener(e[1], e[2], e[3]); | ||
} | ||
}.bind(this)); | ||
Array.prototype.forEach.call(targets, function (target) { | ||
index = this.indexOfListener(target, event, listener, useCapture); | ||
if (index !== -1) { | ||
e = this.events.splice(index, 1)[0]; | ||
e[0].removeEventListener(e[1], e[2], e[3]); | ||
} | ||
}.bind(this)); | ||
} | ||
}, | ||
@@ -66,0 +68,0 @@ |
@@ -74,3 +74,5 @@ (function () { | ||
hidePreview: function () { | ||
this.anchorPreview.classList.remove('medium-editor-anchor-preview-active'); | ||
if (this.anchorPreview) { | ||
this.anchorPreview.classList.remove('medium-editor-anchor-preview-active'); | ||
} | ||
this.activeAnchor = null; | ||
@@ -77,0 +79,0 @@ }, |
@@ -7,3 +7,4 @@ (function () { | ||
LINK_REGEXP_TEXT, | ||
KNOWN_TLDS_REGEXP; | ||
KNOWN_TLDS_REGEXP, | ||
LINK_REGEXP; | ||
@@ -30,2 +31,4 @@ WHITESPACE_CHARS = [' ', '\t', '\n', '\r', '\u00A0', '\u2000', '\u2001', '\u2002', '\u2003', | ||
LINK_REGEXP = new RegExp(LINK_REGEXP_TEXT, 'gi'); | ||
function nodeIsNotInsideAnchorTag(node) { | ||
@@ -212,8 +215,7 @@ return !MediumEditor.util.getClosestTag(node, 'a'); | ||
findLinkableText: function (contenteditable) { | ||
var linkRegExp = new RegExp(LINK_REGEXP_TEXT, 'gi'), | ||
textContent = contenteditable.textContent, | ||
var textContent = contenteditable.textContent, | ||
match = null, | ||
matches = []; | ||
while ((match = linkRegExp.exec(textContent)) !== null) { | ||
while ((match = LINK_REGEXP.exec(textContent)) !== null) { | ||
var matchOk = true, | ||
@@ -220,0 +222,0 @@ matchEnd = match.index + match[0].length; |
@@ -140,3 +140,3 @@ # Walkthrough - Building a Button | ||
init: function () { | ||
this.classApplier = rangy.createCssClassApplier('highlight', { | ||
this.classApplier = rangy.createClassApplier('highlight', { | ||
elementTagName: 'mark', | ||
@@ -204,3 +204,3 @@ normalize: true | ||
init: function () { | ||
this.classApplier = rangy.createCssClassApplier('highlight', { | ||
this.classApplier = rangy.createClassApplier('highlight', { | ||
elementTagName: 'mark', | ||
@@ -278,3 +278,3 @@ normalize: true | ||
contentFA: '<i class="fa fa-paint-brush"></i>', // innerHTML of button when 'fontawesome' is being used | ||
aria: 'Hightlight', // used as both aria-label and title attributes | ||
aria: 'Highlight', // used as both aria-label and title attributes | ||
action: 'highlight', // used as the data-action attribute of the button | ||
@@ -285,3 +285,3 @@ | ||
this.classApplier = rangy.createCssClassApplier('highlight', { | ||
this.classApplier = rangy.createClassApplier('highlight', { | ||
elementTagName: 'mark', | ||
@@ -288,0 +288,0 @@ normalize: true |
@@ -226,7 +226,6 @@ /*global NodeFilter*/ | ||
endSplitPoint; | ||
textIndexOfEndOfFarthestNode = currentTextIndex + (newNode || currentNode).nodeValue.length + | ||
(newNode ? currentNode.nodeValue.length : 0) - | ||
1; | ||
endSplitPoint = (newNode || currentNode).nodeValue.length - | ||
(textIndexOfEndOfFarthestNode + 1 - matchEndIndex); | ||
textIndexOfEndOfFarthestNode = currentTextIndex + currentNode.nodeValue.length + | ||
(newNode ? newNode.nodeValue.length : 0) - 1; | ||
endSplitPoint = matchEndIndex - currentTextIndex - | ||
(newNode ? currentNode.nodeValue.length : 0); | ||
if (textIndexOfEndOfFarthestNode >= matchEndIndex && | ||
@@ -233,0 +232,0 @@ currentTextIndex !== textIndexOfEndOfFarthestNode && |
@@ -18,3 +18,3 @@ MediumEditor.parseVersionString = function (release) { | ||
// grunt-bump looks for this: | ||
'version': '5.22.1' | ||
'version': '5.22.2' | ||
}).version); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1944627
25086