Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

ignore html files with missing base element #1237

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/api/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ async function _export({

let tasks = [];

handle_html:
if (range === 2) {
if (type === 'text/html') {
// parse link rel=preload headers and embed them in the HTML
Expand All @@ -187,6 +188,12 @@ async function _export({

const base_match = /<base ([\s\S]+?)>/m.exec(cleaned);
const base_href = base_match && get_href(base_match[1]);
if (base_href === null) {
oninfo({
message: `ignoring html file with missing base element`
});
break handle_html
}
const base = resolve(url.href, base_href);

let match;
Expand Down