Skip to content

Commit b6dc0a1

Browse files
committed
Fix error if URL is not available
1 parent b81b22c commit b6dc0a1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/util/resolve.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function resolve(h, url) {
77
return ''
88
}
99

10+
/* istanbul ignore next - ignored for older Node */
1011
if (h.frozenBaseURL && typeof URL !== 'undefined') {
1112
return String(new URL(url, h.frozenBaseURL))
1213
}

test/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ test('fixtures', function(t) {
9090
t.end()
9191

9292
function check(name) {
93+
var ignore = /^base\b/.test(name) && typeof URL === 'undefined'
94+
9395
t.test(name, function(st) {
9496
var input = String(
9597
fs.readFileSync(path.join(fixtures, name, 'index.html'))
@@ -128,6 +130,11 @@ test('fixtures', function(t) {
128130
assert(tree)
129131
}, 'should produce valid MDAST nodes')
130132

133+
if (ignore) {
134+
st.end()
135+
return
136+
}
137+
131138
if (!config || config.stringify !== false) {
132139
st.deepEqual(
133140
remark.stringify(tree),

0 commit comments

Comments
 (0)