Skip to content

Commit

Permalink
Merge pull request #5 from thoughtsunificator/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
thoughtsunificator authored Oct 8, 2024
2 parents e9cb903 + 1a9473c commit 00d6584
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ jobs:
- name: Generate documentation
run: npm run generate-docs

- name: nojekyll
run: touch docs/.nojekyll

- name: CNAME
run: echo "$CNAME" > docs/CNAME
if: env.CNAME != ''
env:
CNAME: ${{ vars.CNAME }}

- name: Push documentation
uses: s0/git-publish-subdir-action@develop
env:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@thoughtsunificator/bbcode-parser",
"version": "1.0.7",
"version": "1.0.8",
"main": "index.js",
"scripts": {
"test": "mocha test/**",
Expand Down
4 changes: 3 additions & 1 deletion src/bbdocument/treewalker.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ class TreeWalker {
if(previousNode !== this._rootNode) {
this._path.push(previousNode)
}
} else if(this.currentNode.nextSibling !== null && !this._path.includes(this.currentNode.nextSibling)) {
} else if(this.currentNode.nextSibling !== null &&
(this._rootBookmark === this.currentNode.parentNode || this._path.includes(this.currentNode.parentNode)) &&
!this._path.includes(this.currentNode.nextSibling)) {
this._path.push(this.currentNode.nextSibling)
this._currentNode = this.currentNode.nextSibling
} else {
Expand Down
15 changes: 14 additions & 1 deletion test/bbdocument/treewalker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ describe("treewalker", () => {
assert.strictEqual(nodeList[13].textContent, "9")
assert.strictEqual(nodeList[14].textContent, "Test")


})

it("nextNode_", () => {
Expand Down Expand Up @@ -96,6 +95,20 @@ describe("treewalker", () => {

})

it("nextNode____", () => {

const bbDocument = Parser.parse("[quote]1[quote][/quote][quote][/quote][/quote]")

let treeWalker = new TreeWalker(bbDocument.documentElement.childNodes[0].childNodes[1])
let nodeList = []
while(treeWalker.nextNode()) {
nodeList.push(treeWalker.currentNode)
}
assert.strictEqual(nodeList.length, 0)


})

it("nextNodeList", () => {

const bbDocument = Parser.parse("[list][*]1[list][*]test[/list][*]2[*]3[*]4[/list]")
Expand Down

0 comments on commit 00d6584

Please sign in to comment.