This function wraps a text in a span tag so that it can be represented in an HTML control.
@param {string} sText
@returns {string}
@private
548987
function (sText) {
			return '<span class="fs0875">' + JSDocUtil.formatTextBlock(sText, {
				linkFormatter: function (target, text) {

					var p;

					target = target.trim().replace(/\.prototype\./g, "#");
					p = target.indexOf("#");
					if ( p === 0 ) {
						// a relative reference - we can't support that
						return "<code>" + target.slice(1) + "</code>";
					}

					if ( p > 0 ) {
						text = text || target; // keep the full target in the fallback text
						target = target.slice(0, p);
					}

					return "<a class=\"jsdoclink\" href=\"#\" data-sap-ui-target=\"" + target + "\">" + (text || target) + "</a>";

				}
			}) + '</span>';
		}
894566
function hyphenateText(dom, forceHyphenateAllChildren) {
    if (dom.childNodes !== undefined) {
      dom.childNodes.forEach(function(node) {
        if (node.nodeName === '#text' && !isSkippable(node) && (forceHyphenateAllChildren || isPresent(options.elements, dom.tagName))) {
          node.value = hypher.hyphenateText(node.value);
        } else {
          hyphenateText(node, isPresent(options.elements, dom.tagName));
        }
      });
    }

    return dom;
  }
1018371
function copyTextUsingDOM (str) {
  const tempElem = document.createElement('div')
  // Setting an individual property does not support `!important`, so we set the
  // whole style instead of just the `-webkit-user-select` property.
  tempElem.setAttribute('style', '-webkit-user-select: text !important')

  // Use shadow DOM if available.
  let spanParent = tempElem
  if (tempElem.attachShadow) {
    spanParent = tempElem.attachShadow({ mode: 'open' })
  }

  const span = document.createElement('span')
  span.innerText = str

  spanParent.appendChild(span)
  document.body.appendChild(tempElem)
  selectionSet(span)

  const result = document.execCommand('copy')

  selectionClear()
  document.body.removeChild(tempElem)

  return result
}
1358849
function renderItemText(oRm, sText, sSearch){
		var i;
		if (sText) {
			i = sText.toUpperCase().indexOf(sSearch.toUpperCase());
			if (i > -1){
				oRm.writeEscaped(sText.slice(0, i));
				oRm.write("<b>");
				oRm.writeEscaped(sText.slice(i, i + sSearch.length));
				oRm.write("</b>");
				sText = sText.substring(i + sSearch.length);
			}
			oRm.writeEscaped(sText);
		}
	}
453566
function (wrapper) {
		var textNode = wrapper.element,
			lines = pick(wrapper.textStr, '').toString()
				.replace(/<(b|strong)>/g, '<span style="font-weight:bold">')
				.replace(/<(i|em)>/g, '<span style="font-style:italic">')
				.replace(/<a/g, '<span')
				.replace(/<\/(b|strong|i|em|a)>/g, '</span>')
				.split(/<br.*?>/g),
			childNodes = textNode.childNodes,
			styleRegex = /style="([^"]+)"/,
			hrefRegex = /href="([^"]+)"/,
			parentX = attr(textNode, 'x'),
			textStyles = wrapper.styles,
			renderAsHtml = textStyles && wrapper.useHTML && !this.forExport,
			htmlNode = wrapper.htmlNode,
			//arr, issue #38 workaround
			width = textStyles && pInt(textStyles.width),
			textLineHeight = textStyles && textStyles.lineHeight,
			lastLine,
			GET_COMPUTED_STYLE = 'getComputedStyle',
			i = childNodes.length;

		// remove old text
		while (i--) {
			textNode.removeChild(childNodes[i]);
		}

		if (width && !wrapper.added) {
			this.box.appendChild(textNode); // attach it to the DOM to read offset width
		}

		each(lines, function (line, lineNo) {
			var spans, spanNo = 0, lineHeight;

			line = line.replace(/<span/g, '|||<span').replace(/<\/span>/g, '</span>|||');
			spans = line.split('|||');

			each(spans, function (span) {
				if (span !== '' || spans.length === 1) {
					var attributes = {},
						tspan = doc.createElementNS(SVG_NS, 'tspan');
					if (styleRegex.test(span)) {
						attr(
							tspan,
							'style',
							span.match(styleRegex)[1].replace(/(;| |^)color([ :])/, '$1fill$2')
						);
					}
					if (hrefRegex.test(span)) {
						attr(tspan, 'onclick', 'location.href=\"' + span.match(hrefRegex)[1] + '\"');
						css(tspan, { cursor: 'pointer' });
					}

					span = (span.replace(/<(.|\n)*?>/g, '') || ' ')
						.replace(/&lt;/g, '<')
						.replace(/&gt;/g, '>');

					// issue #38 workaround.
					/*if (reverse) {
						arr = [];
						i = span.length;
						while (i--) {
							arr.push(span.charAt(i));
						}
						span = arr.join('');
					}*/

					// add the text node
					tspan.appendChild(doc.createTextNode(span));

					if (!spanNo) { // first span in a line, align it to the left
						attributes.x = parentX;
					} else {
						// Firefox ignores spaces at the front or end of the tspan
						attributes.dx = 3; // space
					}

					// first span on subsequent line, add the line height
					if (!spanNo) {
						if (lineNo) {

							// allow getting the right offset height in exporting in IE
							if (!hasSVG && wrapper.renderer.forExport) {
								css(tspan, { display: 'block' });
							}

							// Webkit and opera sometimes return 'normal' as the line height. In that
							// case, webkit uses offsetHeight, while Opera falls back to 18
							lineHeight = win[GET_COMPUTED_STYLE] &&
								pInt(win[GET_COMPUTED_STYLE](lastLine, null).getPropertyValue('line-height'));

							if (!lineHeight || isNaN(lineHeight)) {
								lineHeight = textLineHeight || lastLine.offsetHeight || 18;
							}
							attr(tspan, 'dy', lineHeight);
						}
						lastLine = tspan; // record for use in next line
					}

					// add attributes
					attr(tspan, attributes);

					// append it
					textNode.appendChild(tspan);

					spanNo++;

					// check width and apply soft breaks
					
					// PATCH by Simon Fishel
                    // - if (width) {
                    // + if (false && width) {
                    // disabling soft breaks because we are coercing our time-based
                    // axes to categories where we only label a subset of the ticks
					
					if (false && width) {
						var words = span.replace(/-/g, '- ').split(' '),
							tooLong,
							actualWidth,
							rest = [];

						while (words.length || rest.length) {
							actualWidth = textNode.getBBox().width;
							tooLong = actualWidth > width;
							if (!tooLong || words.length === 1) { // new line needed
								words = rest;
								rest = [];
								if (words.length) {
									tspan = doc.createElementNS(SVG_NS, 'tspan');
									attr(tspan, {
										dy: textLineHeight || 16,
										x: parentX
									});
									textNode.appendChild(tspan);

									if (actualWidth > width) { // a single word is pressing it out
										width = actualWidth;
									}
								}
							} else { // append to existing line tspan
								tspan.removeChild(tspan.firstChild);
								rest.unshift(words.pop());
							}
							if (words.length) {
								tspan.appendChild(doc.createTextNode(words.join(' ').replace(/- /g, '-')));
							}
						}
					}
				}
			});
		});

		// Fix issue #38 and allow HTML in tooltips and other labels
		if (renderAsHtml) {
			if (!htmlNode) {
				htmlNode = wrapper.htmlNode = createElement('span', null, extend(textStyles, {
					position: ABSOLUTE,
					top: 0,
					left: 0
				}), this.box.parentNode);
			}
			htmlNode.innerHTML = wrapper.textStr;

			i = childNodes.length;
			while (i--) {
				childNodes[i].style.visibility = HIDDEN;
			}
		}
	}
215371
function htmlString(target, tag, attributes, linebreak) {
		var wrap = getHTMLWrap((tag || 'span'), (attributes || {style: 'white-space:pre;font-family:monospace;'}), linebreak);
		var mw = core.base();
		mw.enabled = true;
		mw.target = target;
		mw.writeln = function (line) {
			if (mw.enabled) {
				mw.target.writeln(wrap(line));
			}
		};
		mw.toString = function () {
			return '<miniwrite-html-string>';
		};
		return mw;
	}
4522
function renderHelpText(text) {
      if (text) {
        if (!helpTextDiv) {
          helpTextDiv = document.createElement("div");
          helpTextDiv.className = 'col-sm-9 col-sm-offset-3 has-error';
          formGroup.appendChild(helpTextDiv);
        }
        helpTextDiv.innerHTML = '<span style="display: block;" class="help-block">' + text + '</span>';
        $(formGroup).addClass('has-error');
        if (inputGroupButton)
          $(inputGroupButton).addClass('btn-danger');
      } else {
        setTimeout(function () {
          if (helpTextDiv) {
            $(helpTextDiv).remove();
            helpTextDiv = null;
          }
        }, 250);
        $(formGroup).removeClass('has-error');
        if (inputGroupButton)
          $(inputGroupButton).removeClass('btn-danger');
      }
    }
517138
def wash_for_js(text):
    
    from invenio_utils.html import escape_javascript_string
    if isinstance(text, six.string_types):
        return '"%s"' % escape_javascript_string(
            text,
            escape_for_html=False,
            escape_CDATA=False,
            escape_script_tag_with_quote=None)
    else:
        return text
83067
function text(txt) {
  if(!this.length) {
    return this;
  }
  if(txt === undefined) {
    return this.dom[0].textContent;
  }
  txt = txt || '';
  this.each(function(el) {
    el.textContent = txt;
  });
  return this;
}
405239
function (selectorText) {
            var rule, css, selector, cssRules = this.cssRules;
            if (selectorText) {
                rule = cssRules[selectorText];
                return rule ? rule.style.cssText : null;
            } else {
                css = [];
                for (selector in cssRules) {
                    rule = cssRules[selector];
                    css.push(rule.selectorText + ' {' + rule.style.cssText + '}');
                }
                return css.join('\n');
            }
        }
293946
function (node) {
    var parentTag = node.parentNode && jsxTagName(node.parentNode.tagName);
    if (parentTag === 'textarea' || parentTag === 'style') {
      // Ignore text content of textareas and styles, as it will have already been moved
      // to a "defaultValue" attribute and "dangerouslySetInnerHTML" attribute respectively.
      return;
    }

    var text = escapeSpecialChars(node.textContent);

    if (this._inPreTag) {
      // If this text is contained within a <pre>, we need to ensure the JSX
      // whitespace coalescing rules don't eat the whitespace. This means
      // wrapping newlines and sequences of two or more spaces in variables.
      text = text
        .replace(/\r/g, '')
        .replace(/( {2,}|\n|\t|\{|\})/g, function (whitespace) {
          return '{' + JSON.stringify(whitespace) + '}';
        });
    } else {
      // Handle any curly braces.
      text = text
        .replace(/(\{|\})/g, function (brace) {
          return '{\'' + brace + '\'}';
        });
      // If there's a newline in the text, adjust the indent level
      if (text.indexOf('\n') > -1) {
        text = text.replace(/\n\s*/g, this._getIndentedNewline());
      }
    }
    this.output += text;
  }
1155094
function(text) {

            urls = [];
            titles = [];
            htmlBlock = [];

            text = text.replace(/~/g,"~T");
            text = text.replace(/\$/g,"~D");
            text = text.replace(/\r\n/g,"\n");
            text = text.replace(/\r/g,"\n");
            text = "\n\n" + text + "\n\n";
            text = detab(text);
            text = text.replace(/^[ \t]+$/mg,"");
            text = hashHTMLBlocks(text);
            text = stripLinkDefinitions(text);
            text = runBlockGamut(text);
            text = unescapeSpecialChars(text);
            text = text.replace(/~D/g,"$$");
            text = text.replace(/~T/g,"~");

            return text;
        }
87389
function escapeHtmlChars(text) 
{
    let ast = myna.parsers.html_reserved_chars(text);
    if (!ast.children)    
        return "";
    return ast.children.map(astNodeToHtmlText).join('');
}
734891
function ( str ) {
            if ( $B.ua.DOC_MODE_IE9_LT ) {
                this.text = function ( str ) {
                    var el = this.element();
    
                    //setter
                    if ( str || str == 0) {
                        el.innerText = String(str);
                        //getter
                    } else {
                        var getStr = el.innerText;
                        return getStr.replace( /[\n\r]+/g, '' );
                    }
                };
            } else {
                this.text = function ( str ) {
                    var el = this.element();
    
                    //setter
                    if ( str || str == 0) {
                        el.textContent = String(str);
                        //getter
                    } else {
                        return el.textContent;
                    }
                };
            }
            return this.text( str );
        }
542405
function htmlBeautify(content) {
    const htmlBeautifyOptions = {
        // wrap_line_length: '80',
        indent_size: 2,
        preserve_newlines: false,
        max_preserve_newlines: 0,
        e4x: true,
        unformatted: [
            'a',
            'span',
            'img',
            'code',
            'pre',
            'sub',
            'sup',
            'em',
            'strong',
            'b',
            'i',
            'u',
            'strike',
            'big',
            'small',
            'pre',
            'h1',
            'h2',
            'h3',
            'h4',
            'h5',
            'h6'
        ]
    };

    // if (isProduction) {
    //     return content;
    // }
    return jsBeautify.html(content, htmlBeautifyOptions);
}
1181350
function (str, x, y) {

		var defaultChartStyle = defaultOptions.chart.style;

		return this.createElement('span')
			.attr({
				text: str,
				x: mathRound(x),
				y: mathRound(y)
			})
			.css({
				whiteSpace: 'nowrap',
				fontFamily: defaultChartStyle.fontFamily,
				fontSize: defaultChartStyle.fontSize
			});
	}
1324195
function (wrapper) {
            var textNode = wrapper.element,
              renderer = this,
              forExport = renderer.forExport,
              textStr = pick(wrapper.textStr, '').toString(),
              hasMarkup = textStr.indexOf('<') !== -1,
              lines,
              childNodes = textNode.childNodes,
              styleRegex,
              hrefRegex,
              parentX = attr(textNode, 'x'),
              textStyles = wrapper.styles,
              width = wrapper.textWidth,
              textLineHeight = textStyles && textStyles.lineHeight,
              textStroke = textStyles && textStyles.HcTextStroke,
              i = childNodes.length,
              getLineHeight = function (tspan) {
                  return textLineHeight ?
                    pInt(textLineHeight) :
                    renderer.fontMetrics(
                      /(px|em)$/.test(tspan && tspan.style.fontSize) ?
                        tspan.style.fontSize :
                        ((textStyles && textStyles.fontSize) || renderer.style.fontSize || 12),
                      tspan
                    ).h;
              };

            /// remove old text
            while (i--) {
                textNode.removeChild(childNodes[i]);
            }

            // Skip tspans, add text directly to text node. The forceTSpan is a hook
            // used in text outline hack.
            if (!hasMarkup && !textStroke && textStr.indexOf(' ') === -1) {
                textNode.appendChild(doc.createTextNode(textStr));
                return;

                // Complex strings, add more logic
            } else {

                styleRegex = /<.*style="([^"]+)".*>/;
                hrefRegex = /<.*href="(http[^"]+)".*>/;

                if (width && !wrapper.added) {
                    this.box.appendChild(textNode); // attach it to the DOM to read offset width
                }

                if (hasMarkup) {
                    lines = textStr
                      .replace(/<(b|strong)>/g, '<span style="font-weight:bold">')
                      .replace(/<(i|em)>/g, '<span style="font-style:italic">')
                      .replace(/<a/g, '<span')
                      .replace(/<\/(b|strong|i|em|a)>/g, '</span>')
                      .split(/<br.*?>/g);

                } else {
                    lines = [textStr];
                }


                // remove empty line at end
                if (lines[lines.length - 1] === '') {
                    lines.pop();
                }


                // build the lines
                each(lines, function (line, lineNo) {
                    var spans, spanNo = 0;

                    line = line.replace(/<span/g, '|||<span').replace(/<\/span>/g, '</span>|||');
                    spans = line.split('|||');

                    each(spans, function (span) {
                        if (span !== '' || spans.length === 1) {
                            var attributes = {},
                              tspan = doc.createElementNS(SVG_NS, 'tspan'),
                              spanStyle; // #390
                            if (styleRegex.test(span)) {
                                spanStyle = span.match(styleRegex)[1].replace(/(;| |^)color([ :])/, '$1fill$2');
                                attr(tspan, 'style', spanStyle);
                            }
                            if (hrefRegex.test(span) && !forExport) { // Not for export - #1529
                                attr(tspan, 'onclick', 'location.href=\"' + span.match(hrefRegex)[1] + '\"');
                                css(tspan, { cursor: 'pointer' });
                            }

                            span = (span.replace(/<(.|\n)*?>/g, '') || ' ')
                              .replace(/&lt;/g, '<')
                              .replace(/&gt;/g, '>');

                            // Nested tags aren't supported, and cause crash in Safari (#1596)
                            if (span !== ' ') {

                                // add the text node
                                tspan.appendChild(doc.createTextNode(span));

                                if (!spanNo) { // first span in a line, align it to the left
                                    if (lineNo && parentX !== null) {
                                        attributes.x = parentX;
                                    }
                                } else {
                                    attributes.dx = 0; // #16
                                }

                                // add attributes
                                attr(tspan, attributes);

                                // Append it
                                textNode.appendChild(tspan);

                                // first span on subsequent line, add the line height
                                if (!spanNo && lineNo) {

                                    // allow getting the right offset height in exporting in IE
                                    if (!hasSVG && forExport) {
                                        css(tspan, { display: 'block' });
                                    }

                                    // Set the line height based on the font size of either
                                    // the text element or the tspan element
                                    attr(
                                      tspan,
                                      'dy',
                                      getLineHeight(tspan)
                                    );
                                }

                                // check width and apply soft breaks
                                if (width) {
                                    var words = span.replace(/([^\^])-/g, '$1- ').split(' '), // #1273
                                      hasWhiteSpace = spans.length > 1 || (words.length > 1 && textStyles.whiteSpace !== 'nowrap'),
                                      tooLong,
                                      actualWidth,
                                      hcHeight = textStyles.HcHeight,
                                      rest = [],
                                      dy = getLineHeight(tspan),
                                      softLineNo = 1,
                                      bBox;

                                    while (hasWhiteSpace && (words.length || rest.length)) {
                                        delete wrapper.bBox; // delete cache
                                        bBox = wrapper.getBBox();
                                        actualWidth = bBox.width;

                                        // Old IE cannot measure the actualWidth for SVG elements (#2314)
                                        if (!hasSVG && renderer.forExport) {
                                            actualWidth = renderer.measureSpanWidth(tspan.firstChild.data, wrapper.styles);
                                        }

                                        tooLong = actualWidth > width;
                                        if (!tooLong || words.length === 1) { // new line needed
                                            words = rest;
                                            rest = [];
                                            if (words.length) {
                                                softLineNo++;
                                                if (hcHeight && softLineNo * dy > hcHeight) {
                                                    words = ['...'];
                                                    wrapper.attr('title', wrapper.textStr);
                                                } else {

                                                    tspan = doc.createElementNS(SVG_NS, 'tspan');
                                                    attr(tspan, {
                                                        dy: dy,
                                                        x: parentX
                                                    });
                                                    if (spanStyle) { // #390
                                                        attr(tspan, 'style', spanStyle);
                                                    }
                                                    textNode.appendChild(tspan);
                                                }
                                            }
                                            if (actualWidth > width) { // a single word is pressing it out
                                                width = actualWidth;
                                            }
                                        } else { // append to existing line tspan
                                            tspan.removeChild(tspan.firstChild);
                                            rest.unshift(words.pop());
                                        }
                                        if (words.length) {
                                            tspan.appendChild(doc.createTextNode(words.join(' ').replace(/- /g, '-')));
                                        }
                                    }
                                }

                                spanNo++;
                            }
                        }
                    });
                });
            }
        }