We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Given the input
<div class="sect2"> <ul> <li> <p>Update </p> <ul> <li> <p>login with credentials</p></li> <li> <p>do something</p> <p> <div class="content"> <pre class="highlightjs highlight"> <code class="language-bash hljs" data-lang="bash">systemctl stop service systemctl start service</code> </pre> </div></p></li> </ul></li> </ul> </div>
when i call
const content = parse(inputGivenAbove) const codeElements = content.querySelectorAll('pre > code')
I would expect
codeElements.length === 1
actually it is
codeElements.length === 0
Node 21.2.0
"devDependencies": { "@jest/globals": "^29.7.0", "@types/node": "^20.10.0", "jest": "^29.7.0", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "typescript": "^5.3.2" }, "dependencies": { "node-html-parser": "^6.1.11" }
The text was updated successfully, but these errors were encountered:
Seems like the parse needs further configuration here. After using
const content = parse(inputGivenAbove, {blockTextElements: {code: true}}) const codeElements = content.querySelectorAll('pre > code')
the output is now as expected
Sorry, something went wrong.
The option {code: true} does not appear in the README
No branches or pull requests
Description
Given the input
when i call
I would expect
actually it is
Context
Node 21.2.0
The text was updated successfully, but these errors were encountered: