@codedoc/core
Version:
Create beautiful modern documentation websites.
21 lines • 922 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.namespace = void 0;
function namespace(config) {
return function (html) {
html.querySelectorAll('a, link').forEach(function (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(function (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'));
}
});
};
}
exports.namespace = namespace;
//# sourceMappingURL=namespace.js.map