MCPcopy Create free account
hub / github.com/UI5/webcomponents / renderTag

Function renderTag

packages/main/test/pages/diffable-html.js:2360–2388  ·  view source on GitHub ↗
(elem, opts)

Source from the content-addressed store, hash-verified

2358 };
2359
2360 function renderTag(elem, opts) {
2361 // Handle SVG
2362 if (elem.name === "svg") opts = {decodeEntities: opts.decodeEntities, xmlMode: true};
2363
2364 var tag = '<' + elem.name,
2365 attribs = formatAttrs(elem.attribs, opts);
2366
2367 if (attribs) {
2368 tag += ' ' + attribs;
2369 }
2370
2371 if (
2372 opts.xmlMode
2373 && (!elem.children || elem.children.length === 0)
2374 ) {
2375 tag += '/>';
2376 } else {
2377 tag += '>';
2378 if (elem.children) {
2379 tag += render(elem.children, opts);
2380 }
2381
2382 if (!singleTag[elem.name] || opts.xmlMode) {
2383 tag += '</' + elem.name + '>';
2384 }
2385 }
2386
2387 return tag;
2388 }
2389
2390 function renderDirective(elem) {
2391 return '<' + elem.data + '>';

Callers 1

diffable-html.jsFile · 0.85

Calls 2

formatAttrsFunction · 0.85
renderFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…