diff --git a/README.md b/README.md index ec83b6c22..78950c5d0 100644 --- a/README.md +++ b/README.md @@ -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 | | --- | --- | --- | diff --git a/src/util/index.ts b/src/util/index.ts index 6533730a3..23eb3255d 100644 --- a/src/util/index.ts +++ b/src/util/index.ts @@ -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 Create a
with id, class and itemtype attributes * @@ -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*