Merge pull request #216 from toasted-nutbread/normalize-xhtml-node-names

Normalize XHTML document node.nodeNode to upper case
This commit is contained in:
Alex Yatskov 2019-09-16 18:31:26 -07:00 committed by GitHub
commit ae696c32eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -105,7 +105,7 @@ function docRangeFromPoint(x, y, options) {
let imposterContainer = null;
if (elements.length > 0) {
const element = elements[0];
switch (element.nodeName) {
switch (element.nodeName.toUpperCase()) {
case 'IMG':
case 'BUTTON':
return new TextSourceElement(element);

View File

@ -88,7 +88,7 @@ class TextSourceRange {
}
const skip = ['RT', 'SCRIPT', 'STYLE'];
if (skip.includes(node.nodeName)) {
if (skip.includes(node.nodeName.toUpperCase())) {
return false;
}
@ -285,7 +285,7 @@ class TextSourceElement {
}
setEndOffset(length) {
switch (this.element.nodeName) {
switch (this.element.nodeName.toUpperCase()) {
case 'BUTTON':
this.content = this.element.innerHTML;
break;