Get HTML with alternate statements striped.
@param {MicroTemplateService} service The MicroTemplateService
@param {Array} branchStatements The branch statements
@param {ASTNode} targetNode The target node.
@returns {BranchedHTML} Branch-processed HTML
430557
function createBranchedHTML(service, branchStatements, targetNode) {
    let template = service.template
    const stripedRanges = []

    /**
     * Strip template  of range.
     * @param  {number} start The start index of range.
     * @param  {number} end The end index of range.
     * @returns {void}
     */
    function strip(start, end) {
        const before = template.slice(0, start)
        const target = template.slice(start, end)
        const after = template.slice(end)
        template = before + target.replace(/\S/gu, " ") + after
        stripedRanges.push([start, end])
    }

    const visitor = {
        IfStatement(node) {
            if (
                node.alternate.range[0] <= targetNode.range[0] &&
                targetNode.range[0] < node.alternate.range[1]
            ) {
                strip(node.consequent.range[0], node.consequent.range[1])
            } else {
                strip(node.alternate.range[0], node.alternate.range[1])
            }
        },
        SwitchStatement(node) {
            let nodeCaseIndex = node.cases.findIndex((cur, index) => {
                const next = node.cases[index + 1]
                const endIndex = next ? next.range[0] : node.range[1]
                return (
                    cur.range[0] <= targetNode.range[0] &&
                    targetNode.range[0] < endIndex
                )
            })
            if (nodeCaseIndex < 0) {
                nodeCaseIndex = 0
            }
            node.cases.forEach((cur, index) => {
                if (index === nodeCaseIndex) {
                    return
                }
                const next = node.cases[index + 1]
                const endIndex = next ? next.range[0] : node.range[1]
                strip(cur.range[0], endIndex)
            })
        },
    }
    for (const node of branchStatements) {
        visitor[node.type](node)
    }

    return new BranchedHTML(
        template,
        service.parseHtml(template),
        stripedRanges
    )
}
623919
@Override
    public void renderBranch( PositionedText target, double x, double y,
                              Size size, Collection<Diagram.Figure> branches, boolean forward )
    {
        throw new UnsupportedOperationException( "not implemented" );
    }
588197
function updateServicesJS(newFileName) {

  console.log(" 🔰  updating: ".cyan + "components.js".white);

  if (process.cwd().includes('client/app/services') === false) {
    process.chdir(`./client/app/services`);
  }

  if (process.cwd().includes(`client/app/services/${newFileName}`) === true) {
    process.chdir('..');
  }

  componentsArray = [];
  genArr = [];


  // sync with updates
  fs.readdir(process.cwd(), function (err, items) {
    genArr = items;
    generateDirectArray(genArr);
  });


  function generateDirectArray(items) {
    for (var i = 0; i < items.length; i++) {
      if (isDirectory(items[i])) {
      } else {
        componentsArray.push(items[i]);
      }
    }
    importStringGenerator();
  }

  function isDirectory(inputString) {
    var str = inputString;
    var patt = new RegExp("[.]");
    var res = patt.test(str);
    return res;
  }

  function importStringGenerator() {

    genString = "";
    for (var i = 0; i < componentsArray.length; i++) {
      genString = genString + `import ${componentsArray[i]}Service from './${componentsArray[i]}/${componentsArray[i]}';\r`
    }

    listString = "";
    for (var i = 0; i < componentsArray.length; i++) {

      // check if last in list in order to not include comma
      if (i === (componentsArray.length - 1)) {
        listString = listString + `  .service('${componentsArray[i]}Service', ${componentsArray[i]}Service);` + `\r`
      } else {
        listString = listString + `  .service('${componentsArray[i]}Service', ${componentsArray[i]}Service)` + `\r`
      }
    }


    fs.writeFile("services.js", `import angular from 'angular';
${genString}

const ServicesModule = angular.module('app.services', [])
${listString}

export default ServicesModule;`, function (err) {
      if (err) {
        return console.log(` ❌  failed to update due to error:  ${err}`);
      }
      console.log(" 🔰  updated: ".cyan + "services.js".white);
    });
  }
}
1158580
function buildHTML(segments) {
		var html = '';
		for (var i=0; i<segments.length; i++) {
			html += buildHTMLForSegment(segments[i]);
		}
		return html;
	}
780756
function(nodes, options) {
        // Only the default or "normal" part of the StyleMap is processed now
        // To do the select or "highlight" bit, we'd need to change lots more

        for(var i=0, len=nodes.length; i<len; i++) {
            var node = nodes[i];
            var pairs = this.getElementsByTagNameNS(node, "*", 
                            "Pair");

            var id = node.getAttribute("id");
            for (var j=0, jlen=pairs.length; j<jlen; j++) {
                var pair = pairs[j];
                // Use the shortcut in the SLD format to quickly retrieve the 
                // value of a node. Maybe it's good to have a method in 
                // Format.XML to do this
                var key = this.parseProperty(pair, "*", "key");
                var styleUrl = this.parseProperty(pair, "*", "styleUrl");

                if (styleUrl && key == "normal") {
                    this.styles[(options.styleBaseUrl || "") + "#" + id] =
                        this.styles[(options.styleBaseUrl || "") + styleUrl];
                }

                // TODO: implement the "select" part
                //if (styleUrl && key == "highlight") {
                //}

            }
        }

    }
374777
function(target, skeleton) {
//            console.log("Applying change: "+JSON.stringify(skeleton));
            if (skeleton == null) {
                return false;
            }
            if (typeof skeleton != typeof target) {
                return false;
            }
            switch (typeof skeleton)
            {
                case 'string':
                case 'number':
                case 'boolean':
                    // gone too far
                    return false;
                case 'object':
                    if (skeleton instanceof Array)
                    {
                        // for now only support direct replacement/mutation of elements, skeleton is insufficient to describe splicing
                        if (target.length != skeleton.length) {
                            return false;
                        }
                        var changed = false;
                        for (var i=0; i<skeleton.length; i++) {
                            if (skeleton[i] == null) {
                                continue;
                            }
                            switch (typeof skeleton[i]) {
                                case 'string':
                                case 'number':
                                case 'boolean':
                                    changed = (target[i] != skeleton[i]) || changed;
                                    target[i] = skeleton[i];
                                    break;
                                case 'object':
                                    changed = deepApply(target[i], skeleton[i]) || changed;
                                    break;
                                default:
                                    throw 'Unrecognized type: '+(typeof skeleton[i]);
                            }
                        }
                        return changed;
                    }
                    else {
                        var changed = false;
                        for (var k in skeleton) {
                            if (skeleton.hasOwnProperty(k)) {
                                if (target.hasOwnProperty(k)) {
                                    if (skeleton[k] == null) {
                                        continue;
                                    }
                                    switch (typeof skeleton[k]) {
                                        case 'string':
                                        case 'number':
                                        case 'boolean':
                                            changed = target[k] != skeleton[k] || changed;
                                            target[k] = skeleton[k];
                                            break;
                                        case 'object':
                                            changed = deepApply(target[k], skeleton[k]) || changed;
                                            break;
                                        default:
                                            throw 'Unrecognized type: '+(typeof skeleton[k]);
                                    }
                                }
                                else {
                                    target[k] = skeleton[k];
                                }
                            }
                        }
                        return changed;
                    }
                    break;
                default:
                    throw 'Unrecognized type: '+(typeof incoming);
            }
        }
913739
function (node, options, recursive) {
			options = (options)? options : {};

			// recursive calls
		    if (recursive === undefined) {
		        if (node.parentNode && node.nodeName !== 'HTML'){
		            return this.getParentTreeWalk(node.parentNode, options, true);
				}else{
		            return this.formatEmpty();
				}
		    }
		    if (node !== null && node !== undefined && node.parentNode) {
		        if (this.isMicroformat( node, options )) {
					// if we have a match return microformat
					options.node = node;
		            return this.get( options );
		        }else{
		            return this.getParentTreeWalk(node.parentNode, options, true);
		        }
		    }else{
		        return this.formatEmpty();
		    }
		}
21721
function () {
    
    var textTemplate = require('./templates/fields/text.html');
    var textareaTemplate = require('./templates/fields/textarea.html');
    var selectTemplate = require('./templates/fields/select.html');
    var checkboxTemplate = require('./templates/fields/checkbox.html');

    var fieldsTarget = []
    $.each(getConfig().customer_fields, function(key, field) {
      var tmpl = textTemplate
      if (field.format === 'textarea') tmpl = textareaTemplate
      if (field.format === 'select') tmpl = selectTemplate
      if (field.format === 'checkbox') tmpl = checkboxTemplate
      if (!field.format) field.format = 'text'
      if (key === 'email') field.format = 'email'
      var data = $.extend({
        key: key,
        arrowDownIcon: require('!svg-inline!./assets/arrow-down-icon.svg')
      }, field)
      var fieldTarget = $(tmpl.render(data))
      fieldsTarget.push(fieldTarget)
    })

    return fieldsTarget
  }
1322017
function html(opts) {
  opts = opts || {}
  var parent = opts.target =  createElement();
  parent.innerHTML = opts.content;
  Splitting(opts)
  return parent.outerHTML
}
809190
static String getStatsHTML(Database db, long requiredHeap, ArrayList<Feedback> warnings) {
        StringBuilder sb = new StringBuilder();
        sb.append("<table class='table table-condensed'>\n");

        // count things
        int indexes = 0, views = 0, statements = 0;
        int partitionedTables = 0, replicatedTables = 0;
        int partitionedProcs = 0, replicatedProcs = 0;
        int readProcs = 0, writeProcs = 0;
        for (Table t : db.getTables()) {
            if (t.getMaterializer() != null) {
                views++;
            }
            else {
                if (t.getIsreplicated()) {
                    replicatedTables++;
                }
                else {
                    partitionedTables++;
                }
            }

            indexes += t.getIndexes().size();
        }
        for (Procedure p : db.getProcedures()) {
            // skip auto-generated crud procs
            if (p.getDefaultproc()) {
                continue;
            }

            if (p.getSinglepartition()) {
                partitionedProcs++;
            }
            else {
                replicatedProcs++;
            }

            if (p.getReadonly()) {
                readProcs++;
            }
            else {
                writeProcs++;
            }

            statements += p.getStatements().size();
        }

        // version
        sb.append("<tr><td>Generated by VoltDB Version</td><td>");
        sb.append(VoltDB.instance().getVersionString()).append("</td></tr>\n");

        // timestamp
        sb.append("<tr><td>Last Schema Update on</td><td>");
        SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z");
        sb.append(sdf.format(m_timestamp)).append("</td></tr>\n");

        // tables
        sb.append("<tr><td>Table Count</td><td>");
        sb.append(String.format("%d (%d partitioned / %d replicated)",
                partitionedTables + replicatedTables, partitionedTables, replicatedTables));
        sb.append("</td></tr>\n");

        // views
        sb.append("<tr><td>Materialized View Count</td><td>").append(views).append("</td></tr>\n");

        // indexes
        sb.append("<tr><td>Index Count</td><td>").append(indexes).append("</td></tr>\n");

        // procedures
        sb.append("<tr><td>Procedure Count</td><td>");
        sb.append(String.format("%d (%d partitioned / %d replicated) (%d read-only / %d read-write)",
                partitionedProcs + replicatedProcs, partitionedProcs, replicatedProcs,
                readProcs, writeProcs));
        sb.append("</td></tr>\n");

        // statements
        sb.append("<tr><td>SQL Statement Count</td><td>").append(statements).append("</td></tr>\n");

        //heap
        sb.append("<tr><td>Required Java Heap</td><td>").append(requiredHeap).append(" Megabytes").append("</td></tr>\n");

        long megabytes = 1024 * 1024;
        long configuredHeap = Runtime.getRuntime().maxMemory() / megabytes;
        if (configuredHeap > requiredHeap) {
            sb.append("<tr><td>Configured Java Heap</td><td>").append(configuredHeap).append(" Megabytes").append("</td></tr>\n");
        } else {
            sb.append("<tr><td>Configured Java Heap</td><td><font color=\"red\">").append(configuredHeap).append("<font color=\"black\">").append(" Megabytes").append("</td></tr>\n");
        }

        sb.append("</table>\n\n");

        // warnings, add warning section if any
        if (warnings.size() > 0){
            sb.append("<h4>Warnings</h4>");
            sb.append("<table class='table table-condensed'>\n");
            for (Feedback warning : warnings) {
                String procName = warning.getFileName().replace(".class", "");
                String nameLink = "";
                // not a warning during compiling procedures, must from the schema
                if (procName.compareToIgnoreCase("null") == 0) {
                    String schemaName = "";
                    String warningMsg = warning.getMessage().toLowerCase();
                    if (warningMsg.contains("table ")) {
                        int begin = warningMsg.indexOf("table ") + 6;
                        int end = (warningMsg.substring(begin)).indexOf(" ");
                        schemaName = warningMsg.substring(begin, begin + end);
                    }
                    nameLink = "<a href='#s-" + schemaName + "'>" + schemaName.toUpperCase() + "</a>";
                } else {
                    nameLink = "<a href='#p-" + procName.toLowerCase() + "'>" + procName + "</a>";
                }
                sb.append("<tr><td>").append(nameLink).append("</td><td>").append(escapeHtml4(warning.getMessage())).append("</td></tr>\n");
            }
            sb.append("</table>\n").append("</td></tr>\n");
        }

        return sb.toString();
    }
1336190
function processNode(node) {
            if (!node.code.trim()) {
                // empty
                return
            }
            const innerTokens = microTemplateService.getMicroTemplateTokensInfo(
                node
            ).innerTokens
            if (!innerTokens.length) {
                context.report({
                    node,
                    messageId: "missingStatement",
                })
                return
            }
            const statement = microTemplateService.getMicroTemplateExpressionStatement(
                node,
                sourceCode
            )
            if (statement) {
                return
            }
            context.report({
                node,
                messageId: "unexpected",
            })
        }
585370
function(markup, targetdoc) {
		return this.parseToNodes(markup, targetdoc).filter(function(node) {
			return node.nodeType === Node.ELEMENT_NODE;
		});
	}
564757
function compileHtml(target) {
	return gulp.src(config.src.html)
		.pipe(gulp.dest(`${config.output.dist}/${target}`))
}
1261637
function renderHtml(fragment, opts) {
    var html = (!fragment || !u.trim(fragment._txt)) ?
      '&nbsp;' : // show space for empty/missing to allow selection/editing
      renderMarkdown(fragment._txt, opts);
    // use opts.noWrap to avoid breaking CSS nested selectors like li > ul in menus
    if (opts && opts.noWrap) return html;
    var href = (fragment && esc(fragment._href)) || '';
    return '<div data-render-html="' + href + '">' + html + '</div>';
  }
30460
@Override protected void visitPrintNode(PrintNode node) {
    Expression expr = translateExpr(node.getExpr());

    // Process directives.
    for (PrintDirectiveNode directiveNode : node.getChildren()) {

      // Get directive.
      SoyPrintDirective directive = directiveNode.getPrintDirective();
      if (!(directive instanceof SoyJsSrcPrintDirective)) {
        errorReporter.report(
            node.getSourceLocation(), UNKNOWN_SOY_JS_SRC_PRINT_DIRECTIVE, directiveNode.getName());
        return;
      }

      // Get directive args.
      List<ExprRootNode> argNodes = directiveNode.getArgs();

      // Convert args to CodeChunks.
      List<Expression> argChunks = new ArrayList<>(argNodes.size());
      for (ExprRootNode argNode : argNodes) {
        argChunks.add(translateExpr(argNode));
      }

      // Apply directive.
      expr =
          SoyJsPluginUtils.applyDirective(
              expr,
              (SoyJsSrcPrintDirective) directive,
              argChunks,
              node.getSourceLocation(),
              errorReporter);
    }

    chunks.add(expr);
  }
417607
function (out, tree) {
            var rootStatement = tree.content[0];
            if (tree.content.length != 1 || (rootStatement.name != this._rootStatement)) {
                return out.logError(tree, this.TEMPLATE_STATEMENT_EXPECTED, [this._rootStatement]);
            }
            if (rootStatement.content == null) {
                return out.logError(rootStatement, this.EXPECTED_CONTAINER, [this._rootStatement]);
            }
            var param;
            try {
                // The parameter should be a JSON object
                param = Aria["eval"]("return (" + rootStatement.paramBlock + ");");
            } catch (e) {
                return out.logError(rootStatement, this.ERROR_IN_TEMPLATE_PARAMETER, [this._rootStatement], e);
            }

            if (!ariaCoreJsonValidator.normalize({
                json : param,
                beanName : this._templateParamBean
            })) {
                return out.logError(rootStatement, this.CHECK_ERROR_IN_TEMPLATE_PARAMETER, [this._rootStatement]);
            }
            out.templateParam = param;
            rootStatement.properties = param;

            this._processTemplateContent({
                out : out,
                statement : rootStatement
            });
        }
351946
function GetHTML(result) {
  if (data.css) result.css = CHTMLSTYLES;
  if (!data.html && !data.htmlNode) return;
  var jax = MathJax.Hub.getAllJax()[0]; if (!jax) return;
  var script = jax.SourceElement(), html = script.previousSibling;

  // add speech text if there isn't one
  if (data.speakText){
    var labelTarget = html.querySelector('.mjx-math');
    for (child of labelTarget.childNodes) child.setAttribute("aria-hidden",true);
    if (!labelTarget.getAttribute("aria-label")){
    labelTarget.setAttribute("aria-label",result.speakText);
    }
  }
  // remove automatically generated IDs
  var ids = html.querySelectorAll('[id^="MJXc-Node-"]');
  for (var i = 0; i < ids.length; i++){
    ids[i].removeAttribute("id");
  }
  // remove extreneous frame element
  var frame = html.querySelector('[id^="MathJax-Element-"]');
  if (frame){
    // in display-mode, the frame is inside the display-style wrapper
    html.insertBefore(frame.firstChild, frame);
    html.removeChild(frame);
  }
  else{
    // otherwise (inline-mode) the frame is the root element
    html.removeAttribute("id");
  }
  if (data.html) result.html = html.outerHTML;
  if (data.htmlNode) result.htmlNode = html;
}