Skip to content

Commit

Permalink
🐛 fix dangling comment node (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
philschatz authored Dec 1, 2023
1 parent 3aecaa9 commit eb1e67e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit eb1e67e

Please sign in to comment.