MCPcopy Create free account
hub / github.com/danmactough/node-feedparser / resolveHtmlUris

Function resolveHtmlUris

lib/utils.js:322–340  ·  view source on GitHub ↗
(html, baseUrl)

Source from the content-addressed store, hash-verified

320}
321
322function resolveHtmlUris (html, baseUrl) {
323 if (!baseUrl || !html || typeof html !== 'string') return html;
324
325 var out = '';
326 var i = 0;
327 while (i < html.length) {
328 if (html[i] === '<') {
329 var markup = readMarkupAt(html, i);
330 if (markup && !markup.alwaysStrip && !markup.isClosing && HTML_TAGS.has(markup.tagName)) {
331 out += rewriteHtmlTagUris(html.slice(i, i + markup.len), baseUrl);
332 i += markup.len;
333 continue;
334 }
335 }
336 out += html[i];
337 i++;
338 }
339 return out;
340}
341
342function mayHaveEmbeddedHtml (name, el) {
343 if (!el || typeof el['#'] !== 'string') return false;

Callers 1

resolveLevelFunction · 0.85

Calls 2

readMarkupAtFunction · 0.85
rewriteHtmlTagUrisFunction · 0.85

Tested by

no test coverage detected