MCPcopy Create free account
hub / github.com/boost-ext/di / addAttributes

Function addAttributes

doc/cppnow-2016/plugin/markdown/markdown.js:312–345  ·  view source on GitHub ↗

* Add attributes to the parent element of a text node, * or the element of an attribute node.

( section, element, previousElement, separatorElementAttributes, separatorSectionAttributes )

Source from the content-addressed store, hash-verified

310 * or the element of an attribute node.
311 */
312 function addAttributes( section, element, previousElement, separatorElementAttributes, separatorSectionAttributes ) {
313
314 if ( element != null && element.childNodes != undefined && element.childNodes.length > 0 ) {
315 previousParentElement = element;
316 for( var i = 0; i < element.childNodes.length; i++ ) {
317 childElement = element.childNodes[i];
318 if ( i > 0 ) {
319 j = i - 1;
320 while ( j >= 0 ) {
321 aPreviousChildElement = element.childNodes[j];
322 if ( typeof aPreviousChildElement.setAttribute == 'function' && aPreviousChildElement.tagName != "BR" ) {
323 previousParentElement = aPreviousChildElement;
324 break;
325 }
326 j = j - 1;
327 }
328 }
329 parentSection = section;
330 if( childElement.nodeName == "section" ) {
331 parentSection = childElement ;
332 previousParentElement = childElement ;
333 }
334 if ( typeof childElement.setAttribute == 'function' || childElement.nodeType == Node.COMMENT_NODE ) {
335 addAttributes( parentSection, childElement, previousParentElement, separatorElementAttributes, separatorSectionAttributes );
336 }
337 }
338 }
339
340 if ( element.nodeType == Node.COMMENT_NODE ) {
341 if ( addAttributeInElement( element, previousElement, separatorElementAttributes ) == false ) {
342 addAttributeInElement( element, section, separatorSectionAttributes );
343 }
344 }
345 }
346
347 /**
348 * Converts any current data-markdown slides in the

Callers 1

convertSlidesFunction · 0.70

Calls 1

addAttributeInElementFunction · 0.70

Tested by

no test coverage detected