Skip to content

Commit

Permalink
fix(client): fix import in html-to-dom.mjs
Browse files Browse the repository at this point in the history
Fixes #337
  • Loading branch information
remarkablemark committed Aug 23, 2022
1 parent 6e51456 commit 78a7607
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/client/html-to-dom.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var domparser = require('./domparser');
var formatDOM = require('./utilities').formatDOM;
var utilities = require('./utilities');

var formatDOM = utilities.formatDOM;

var DIRECTIVE_REGEX = /<(![a-zA-Z\s]+)>/; // e.g., <!doctype html>

Expand Down
8 changes: 4 additions & 4 deletions lib/client/html-to-dom.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import domparser from './domparser.js';
import { formatDOM } from './utilities.js';
import utilities from './utilities.js';

var formatDOM = utilities.formatDOM;

var DIRECTIVE_REGEX = /<(![a-zA-Z\s]+)>/; // e.g., <!doctype html>

Expand All @@ -9,7 +11,7 @@ var DIRECTIVE_REGEX = /<(![a-zA-Z\s]+)>/; // e.g., <!doctype html>
* @param {string} html - HTML markup.
* @return {DomElement[]} - DOM elements.
*/
function HTMLDOMParser(html) {
export default function HTMLDOMParser(html) {
if (typeof html !== 'string') {
throw new TypeError('First argument must be a string');
}
Expand All @@ -28,5 +30,3 @@ function HTMLDOMParser(html) {

return formatDOM(domparser(html), null, directive);
}

export default HTMLDOMParser;

0 comments on commit 78a7607

Please sign in to comment.