// loaders.gl // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors import { mergeLoaderOptions } from '@loaders.gl/loader-utils'; import { XMLLoader } from "./xml-loader.js"; /** * Loader for HTML files * Essentially a copy of the XMLLoader with different mime types, file extensions and content tests. * This split enables applications can control whether they want HTML responses to be parsed by the XML loader or not. * This loader does not have any additional understanding of the structure of HTML or the document. */ export const HTMLLoader = { ...XMLLoader, name: 'HTML', id: 'html', extensions: ['html', 'htm'], mimeTypes: ['text/html'], testText: testHTMLFile, parse: async (arrayBuffer, options) => parseTextSync(new TextDecoder().decode(arrayBuffer), options), parseTextSync: (text, options) => parseTextSync(text, options) }; function testHTMLFile(text) { // TODO - There could be space first. return text.startsWith('