Skip to content

Commit c36b52b

Browse files
.gitignore for coverage.
1 parent 1e3e892 commit c36b52b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.git/
22

3+
coverage/
34
demo/
45
dist/
56
node_modules/

src/dom/functions.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,13 @@ export function domTraverseElements(node: any, opt_pre: any, opt_post: any) {
113113
}
114114
}
115115

116-
// Parses the given XML string with our custom, JavaScript XML parser. Written
117-
// by Steffen Meschkat (mesch@google.com).
118-
export function xmlParse(xml: string) {
116+
/**
117+
* Parses the given XML string with our custom, JavaScript XML parser
118+
* @param xml The XML String.
119+
* @returns A XDocument.
120+
* @author Steffen Meschkat <mesch@google.com>
121+
*/
122+
export function xmlParse(xml: string): XDocument {
119123
const regex_empty = /\/$/;
120124

121125
let regex_tagname;
@@ -207,7 +211,7 @@ export function xmlParse(xml: string) {
207211
doublequotes = false;
208212
} else if (!tag && char === '<') {
209213
let text = xml.slice(start, i);
210-
if (text && parent != root) {
214+
if (text && parent !== root) {
211215
domAppendChild(parent, domCreateTextNode(xmldoc, text));
212216
}
213217
if (xml.slice(i + 1, i + 4) === '!--') {

0 commit comments

Comments
 (0)