12 lines
405 B
Plaintext
12 lines
405 B
Plaintext
'use strict';
|
|
|
|
function iconToHTML(body, attributes) {
|
|
let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
for (const attr in attributes) {
|
|
renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
|
|
}
|
|
return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
|
|
}
|
|
|
|
exports.iconToHTML = iconToHTML;
|