UNPKG

@codedoc/core

Version:

Create beautiful modern documentation websites.

17 lines 777 B
export function namespace(config) { return function (html) { html.querySelectorAll('a, link').forEach(el$ => { var _a; if (el$.getAttribute('href') && ((_a = el$.getAttribute('href')) === null || _a === void 0 ? void 0 : _a.startsWith('/'))) { el$.setAttribute('href', config.dest.namespace + el$.getAttribute('href')); } }); html.querySelectorAll('script, img').forEach(el$ => { var _a; if (el$.getAttribute('src') && ((_a = el$.getAttribute('src')) === null || _a === void 0 ? void 0 : _a.startsWith('/'))) { el$.setAttribute('src', config.dest.namespace + el$.getAttribute('src')); } }); }; } //# sourceMappingURL=namespace.js.map