allow case sensitive yxml nodes
This commit is contained in:
parent
4c38619b5d
commit
e7280c7ae2
@ -24,7 +24,7 @@ import * as decoding from 'lib0/decoding.js'
|
|||||||
export class YXmlElement extends YXmlFragment {
|
export class YXmlElement extends YXmlFragment {
|
||||||
constructor (nodeName = 'UNDEFINED') {
|
constructor (nodeName = 'UNDEFINED') {
|
||||||
super()
|
super()
|
||||||
this.nodeName = nodeName.toUpperCase()
|
this.nodeName = nodeName
|
||||||
/**
|
/**
|
||||||
* @type {Map<string, any>|null}
|
* @type {Map<string, any>|null}
|
||||||
* @private
|
* @private
|
||||||
|
@ -169,7 +169,7 @@ export class YXmlFragment extends AbstractType {
|
|||||||
querySelector (query) {
|
querySelector (query) {
|
||||||
query = query.toUpperCase()
|
query = query.toUpperCase()
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const iterator = new YXmlTreeWalker(this, element => element.nodeName === query)
|
const iterator = new YXmlTreeWalker(this, element => element.nodeName && element.nodeName.toUpperCase() === query)
|
||||||
const next = iterator.next()
|
const next = iterator.next()
|
||||||
if (next.done) {
|
if (next.done) {
|
||||||
return null
|
return null
|
||||||
@ -192,7 +192,7 @@ export class YXmlFragment extends AbstractType {
|
|||||||
querySelectorAll (query) {
|
querySelectorAll (query) {
|
||||||
query = query.toUpperCase()
|
query = query.toUpperCase()
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return Array.from(new YXmlTreeWalker(this, element => element.nodeName === query))
|
return Array.from(new YXmlTreeWalker(this, element => element.nodeName && element.nodeName.toUpperCase() === query))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user