Skip to content

Commit c2ef2db

Browse files
Merge pull request #338 from remarkablemark/fix/module
fix(client): fix import in html-to-dom.mjs
2 parents 6e51456 + 78a7607 commit c2ef2db

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/client/html-to-dom.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
var domparser = require('./domparser');
2-
var formatDOM = require('./utilities').formatDOM;
2+
var utilities = require('./utilities');
3+
4+
var formatDOM = utilities.formatDOM;
35

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

lib/client/html-to-dom.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import domparser from './domparser.js';
2-
import { formatDOM } from './utilities.js';
2+
import utilities from './utilities.js';
3+
4+
var formatDOM = utilities.formatDOM;
35

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

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

2931
return formatDOM(domparser(html), null, directive);
3032
}
31-
32-
export default HTMLDOMParser;

0 commit comments

Comments
 (0)