Skip to content

Commit

Permalink
Context-less template() + template source symbol support
Browse files Browse the repository at this point in the history
  • Loading branch information
Lcfvs committed Jul 1, 2021
1 parent 51df3d4 commit da2e6b2
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 271 deletions.
13 changes: 9 additions & 4 deletions lib/backend.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import jsdom from 'jsdom'
import * as dom from './dom.js'
import { serializer } from './dom.js'
export { template } from './template.js'

const window = new jsdom.JSDOM('<!DOCTYPE html>').window
const { window } = new jsdom.JSDOM('<!DOCTYPE html>')
const { document, DOMParser, XMLSerializer } = window

export const template = dom.template.bind(dom, window)
export const serialize = dom.serialize
export const serialize = serializer({
document,
parser: new DOMParser(),
serializer: new XMLSerializer()
})
Loading

0 comments on commit da2e6b2

Please sign in to comment.