Skip to content

Commit

Permalink
fix logic in htmlToNode
Browse files Browse the repository at this point in the history
  • Loading branch information
nickforddev committed Jul 3, 2020
1 parent 11d841e commit cd09b44
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/freezeframe/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ export const htmlToNode = (html: string) => {
const $wrap = window.document.createElement('div');
$wrap.innerHTML = html;
const $content = $wrap.childNodes;
// return $content.length > 1
// ? $content
// : $content[0];
return $content[0] as HTMLElement;
return ($content.length > 1
? $content
: $content[0]) as HTMLElement;
};

export const wrapNode = ($el: HTMLElement, $wrapper: HTMLElement) => {
Expand Down

0 comments on commit cd09b44

Please sign in to comment.