MCPcopy Create free account
hub / github.com/TruthHun/BookStack / _toNode

Function _toNode

static/katex/katex.js:952–977  ·  view source on GitHub ↗
(tagName)

Source from the content-addressed store, hash-verified

950
951
952var _toNode = function toNode(tagName) {
953 var node = document.createElement(tagName); // Apply the class
954
955 node.className = createClass(this.classes); // Apply inline styles
956
957 for (var style in this.style) {
958 if (this.style.hasOwnProperty(style)) {
959 // $FlowFixMe Flow doesn't seem to understand span.style's type.
960 node.style[style] = this.style[style];
961 }
962 } // Apply attributes
963
964
965 for (var attr in this.attributes) {
966 if (this.attributes.hasOwnProperty(attr)) {
967 node.setAttribute(attr, this.attributes[attr]);
968 }
969 } // Append the children, also as HTML nodes
970
971
972 for (var i = 0; i < this.children.length; i++) {
973 node.appendChild(this.children[i].toNode());
974 }
975
976 return node;
977};
978/**
979 * Convert into an HTML markup string
980 */

Callers

nothing calls this directly

Calls 3

createClassFunction · 0.70
setAttributeMethod · 0.45
toNodeMethod · 0.45

Tested by

no test coverage detected