-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5cb8039
commit a45b9a8
Showing
7 changed files
with
59 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
const getAttribute = require("./get-attribute"); | ||
const findTagByName = require("./find-tag-by-name"); | ||
const findTagsByName = require("./find-tags-by-name"); | ||
const findTagByPath = require("./find-tag-by-path"); | ||
const findTagsByPath = require("./find-tags-by-path"); | ||
const removeComments = require("./remove-comments"); | ||
const getAttribute = require("./get-attribute.js"); | ||
const findTagByName = require("./find-tag-by-name.js"); | ||
const findTagsByName = require("./find-tags-by-name.js"); | ||
const findTagByPath = require("./find-tag-by-path.js"); | ||
const findTagsByPath = require("./find-tags-by-path.js"); | ||
const removeComments = require("./remove-comments.js"); | ||
const removeTagsByName = require("./remove-tags-by-name.js"); | ||
|
||
module.exports = { | ||
getAttribute, | ||
findTagByName, | ||
findTagsByName, | ||
findTagByPath, | ||
findTagsByPath, | ||
removeComments | ||
removeComments, | ||
removeTagsByName | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const findTagByName = require("./find-tag-by-name.js"); | ||
|
||
function removeTagsByName(xml, tagName, options) { | ||
const debug = (options && options.debug) || false; | ||
let tag; | ||
while ((tag = findTagByName(xml, tagName, { debug }))) { | ||
xml = xml.substring(0, tag.start) + xml.substring(tag.end); | ||
if (debug) console.log("[xml-utils] removed:", tag); | ||
} | ||
return xml; | ||
} | ||
|
||
module.exports = removeTagsByName; | ||
module.exports.default = removeTagsByName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters