MCPcopy Create free account
hub / github.com/Samirla/xmlview / stylizeComment

Function stylizeComment

src/renderer.js:177–191  ·  view source on GitHub ↗

* @param {Element} node * @return {String}

(node)

Source from the content-addressed store, hash-verified

175 * @param {Element} node
176 * @return {String}
177 */
178 function stylizeComment(node) {
179 var v = xv_utils.trim(node.nodeValue),
180 class_name = 'xv-node xv-comment';
181
182 if (v.length < oneline_text_len) {
183 class_name += ' xv-one-line';
184 }
185
186 return '<span class="' + class_name + '" data-xv-id="' + generateId(node) + '">' +
187 '<span class="xv-tag-switcher"></span>' +
188 '<span class="xv-comment-start">&lt;!-- </span>' +
189 '<span class="xv-comment-value">' + processText(v) + '</span>' +
190 '<span class="xv-comment-end"> --&gt;</span>' +
191 '</span>';
192 }
193
194 /**

Callers 1

stylizeFunction · 0.70

Calls 2

generateIdFunction · 0.85
processTextFunction · 0.70

Tested by

no test coverage detected