Skip to content
New issue

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

🐛 fix dangling comment node #185

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/webview-js/cnxml-preview/cnxml-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ const handleRefresh = (xml, xsl) => {
}
case Node.DOCUMENT_FRAGMENT_NODE: {
// Wrap the children of the document fragment in a <div>
const children = [...xmlNode.childNodes].map(c => recBuildVDom(c))
const children = [...xmlNode.childNodes].map(c => recBuildVDom(c)).filter(c => !!c)
return vdom_h('DIV', {}, ...children)
}
default: {
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/cnxml-preview-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { PanelStateMessage, PanelStateMessageType } from '../../common/src/webvi
})
}
function createCnxmlFromContent(content: string): string {
return `<document xmlns="http://cnx.rice.edu/cnxml"><content>${content}</content></document>`
return `<document xmlns="http://cnx.rice.edu/cnxml"><content>${content}</content></document><!-- extra bit for testing -->`
}
function sendScrollToLine(line: number): void {
sendMessage({ type: 'scroll-in-preview', line })
Expand Down
Loading