Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
fix(Utils): Include element children when cloning a node
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ketch committed Aug 6, 2020
1 parent 6057769 commit 8a438e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,7 @@ Create a new element.
(a) a HTML (or SVG) string (b) a CSS selector like string, or (c) an `Element`.
CSS selectors are a convenient way to create elements with attributes,
particularly Microdata elements. They can be prone to syntax errors however.
Alternatively, the second argument can
be an object of attribute name:value pairs.
Alternatively, the second argument can be an object of attribute name:value pairs.

| Param | Type | Description |
| --- | --- | --- |
Expand Down
5 changes: 2 additions & 3 deletions src/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ export function select(...args: (string | Document | Element)[]): Element[] {
* (a) a HTML (or SVG) string (b) a CSS selector like string, or (c) an `Element`.
* CSS selectors are a convenient way to create elements with attributes,
* particularly Microdata elements. They can be prone to syntax errors however.
* Alternatively, the second argument can
* be an object of attribute name:value pairs.
* Alternatively, the second argument can be an object of attribute name:value pairs.
*
* @example <caption>Create a <figure> with id, class and itemtype attributes</caption>
*
Expand Down Expand Up @@ -193,7 +192,7 @@ export function create(
let elem: Element
if (spec instanceof Element) {
// Create as clone of existing element
elem = spec.cloneNode() as Element
elem = spec.cloneNode(true) as Element
} else if (/^\s*</.test(spec)) {
// Create from HTML
const wrapper = document.createElement('div')
Expand Down

0 comments on commit 8a438e8

Please sign in to comment.