Generates HTML Visualisation of current tape.
@access		public
@param		string		$tape			current tape
@return		string
518422
public function showTape( $tape )
	{
		for( $i=0; $i<strlen( $tape ); $i++ )
		{
			$sign = substr( $tape, $i, 1 );
			if( $i == $this->pointer )
				$lines[] = "<td style='background: #FF7F7F'>".$sign."</td>";
			else
				$lines[] = "<td>".$sign."</td>";
		}
//		return "<code>(".$this->state.") ".implode( "", $lines)."</code><br>";
		return "<tr><td>(".$this->state.")</td>".implode( "", $lines )."</tr>";
	}
33994
public static function Html($html): string
    {
        // Remove newlines, tabs, zero
        $html = str_replace(["\0", "\t", "\r"], '', $html);

        // Remove spaces
        while (strpos($html, '  ') !== false) {
            $html = str_replace('  ', ' ', $html);
        }

        // Remove spaces after new lines
        $html = str_replace("\n ", "\n", $html);

        // Can optimize only without textarea, because in have to keep formatting
        $textarea = strpos($html, '<textarea');
        if ($textarea !== false) {
            // Remove double newlines
            while (strpos($html, "\n\n") !== false) {
                $html = str_replace("\n\n", "\n", $html);
            }
        }

        $fl = substr($html, 0, strpos($html, "\n")); // First line
        if (stripos($fl, 'strict') === false && substr($fl, 0, 5) !== '<?xml') {
            $html = str_replace('/>', '>', $html);
            if ($textarea === false) {
                $html = preg_replace('/([a-zA-Z0-9]+="[^"]+") /', '\\1', $html);
            }
        }
        $html = str_replace([' />'], ['/>'], $html);

        if ($textarea === false) {
            $html = str_replace("\n", '', $html);
        }

        return $html;
    }
1145875
static function getOutputEncodingHtml()
    {

        $txt = '';
        $tmp1 = '<meta http-equiv="Content-Type" content="text/html; charset=';
        $tmp2 = '" />';
        switch (ReporticoApp::getConfig("output_encoding")) {
            case "None":$txt = '';
                break;
            case "UTF8":$txt = $tmp1 . "utf-8" . $tmp2;'<meta charset="utf-8">';
                break;
            default:$txt = $tmp1 . ReporticoApp::getConfig("output_encoding") . $tmp2;
                break;
        }

        return $txt;
    }
893467
function toHTML()
    {

        // get private attributes
        $attributes = $this->get_attributes('label');

        // if access key needs to be showed
        if (preg_match('/(?<!\\\)\$(.{1})/', $attributes['label'], $matches) > 0) {

            // set the requested accesskey
            $this->set_attributes(array('accesskey' => strtolower($matches[1])));

            // make the accesskey visible
            $attributes['label'] = preg_replace('/\$(.{1})/', '<span class="underline">$1</span>', $attributes['label']);

        }

        return '<label ' . $this->_render_attributes() . '>' . preg_replace('/\\\\\$/', '$', $attributes['label']) . '</label>';

    }
1218612
private function getHtmlBeginning()
	{
		$html = '<' . $this->tagName;

		foreach ($this->attributes as $name => $value) {
			$html .= ' ' . $name . '="' . htmlspecialchars($value) . '"';
		}

		return $html;
	}
677346
public function render($indent = "\t")
    {
        $html = '';
        foreach(self::$storage as $meta) {
            $html .= $indent . $meta->render() . PHP_EOL;
        }
        
        return $html;
    }
779133
public function _htmlHeader($title)
    {

        $output = $this->_doctype();
        $output .= '<html lang="en">'."\n";
        $output .= "<head>\n\n";

        $output .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'."\n\n";
        $output .= '<meta name="generator" content="PHPDoctor '.$this->_doclet->version().' (http://peej.github.com/phpdoctor/)">'."\n";
        $output .= '<meta name="when" content="'.gmdate('r').'">'."\n\n";

        $output .= '<link rel="stylesheet" type="text/css" href="'.str_repeat('../', $this->_depth).'stylesheet.css">'."\n";
        $output .= '<link rel="start" href="'.str_repeat('../', $this->_depth).'namespaces.html">'."\n\n";

        $output .= '<title>';
        if ($title) {
            $output .= $title.' ('.$this->_doclet->windowTitle().')';
        } else {
            $output .= $this->_doclet->windowTitle();
        }
        $output .= "</title>\n\n";
        $output .= "</head>\n";

        return $output;

    }
894834
public function render($html = null) {
		if ($this->_tagCached === null) {
			$tag = '<' . $this->_tag;
			
			// Classes
			if (! empty($this->_classes)) {
				$this->setAttr(
					self::ATTR_CLASS,
					implode(' ', $this->_classes)
				);
			}

			// Style
			if (! empty($this->_style)) {
				$style = [];
				
				foreach ($this->_style as $param => $value) {
					$style[] = $param . ':' . $value . ';';
				}
				
				$this->setAttr(
					self::ATTR_STYLE,
					implode(' ', $style)
				);
			}

			// Attrs
			if (! empty($this->_attrs)) {
				$attrs = [];
				
				foreach ($this->_attrs as $attr => $value) {
					$attrs[] = $attr . '="' . $value . '"';
				}

				$tag .= ' ' .  implode(' ', $attrs);
			}
			
			$tag .= $this->_closed ? ' />' : '>';
			
			$this->_tagCached = $tag;
		}
		
		if ($this->_closed) {
			return $this->_tagCached;
		}
			
		return $this->_tagCached . ($html === null ? $this->_html : $html) . '</' . $this->_tag . '>';
	}
750463
function decorateTape(tape) {
  tape.Test.prototype.html = function (message) {
    var that = this;
    trim(message).split('\n').forEach(function (aMsg) {
      that.emit('result', trim(aMsg).replace(/^\s*/, '#tapeworm-html'));
    });
  };
}
661954
public function getHtml()
    {
        $html = array();
        
        if (count($this->m_trendlines) > 0)
        {
            $this->m_options['trendlines'] = json_decode(json_encode($this->m_trendlines, JSON_FORCE_OBJECT)); 
        }
        
        # debug hacks
        $this->m_options['seriesType'] = 'lines';
        $chartType = "ScatterChart"; # LineChart
        
        $html[] = "var data = google.visualization.arrayToDataTable(" . json_encode($this->m_data, JSON_PRETTY_PRINT) . ");";
        $html[] = "var options = " . json_encode($this->m_options) . ";";
        $html[] = "var chart = new google.visualization." . $chartType . "(document.getElementById('" . $this->m_anchorId . "'));";
        
        if ($this->m_clickHandler != null)
        {
            $html[] = "google.visualization.events.addListener(chart, 'click', " . $this->m_clickHandler . ");";
        }
        
        if ($this->m_selectHandler != null)
        {
            $html[] = "google.visualization.events.addListener(chart, 'select', " . $this->m_selectHandler . ");";
        }
        
        $html[] = "chart.draw(data, options);";
        
        return implode(PHP_EOL, $html);
    }
1095175
public function getHtml($path)
    {
        if (!$this->docs->has($path)) {
            return '';
        }
        if (!$this->cache || !$this->cache->has($path) || $this->docs->getTimestamp($path) > $this->cache->getTimestamp($path)) {
            $text = $this->docs->read($path);
            $mark = $this->makeMark();
            $html = $mark->convertToHtml($text['contents']);
            if ($this->cache) {
                $this->cache->write($path, $html, new Config());
            }
            return $html;
        }
        $contents = $this->cache->read($path);
        return $contents['contents'];
    }
600944
public function render($html = null) {
		$separator = $this->getSeparator();
		$result    = '';
		
		if ($this->_colgroup !== null) {
			$result .= $separator . $this->_colgroup->render();
		}
		
		if ($this->_head !== null) {
			$result .= $separator . $this->_head->render();
		}
		
		if ($this->_body !== null) {
			$result .= $separator . $this->_body->render();
		}
		
		if ($this->_foot !== null) {
			$result .= $separator . $this->_foot->render();
		}
		
		return parent::render($result . $separator);
	}
495686
public static function reformatRecord($rec): string
    {
        $newrec = '';
        foreach (preg_split('/[\r\n]+/', $rec, -1, PREG_SPLIT_NO_EMPTY) as $line) {
            // Split long lines
            // The total length of a GEDCOM line, including level number, cross-reference number,
            // tag, value, delimiters, and terminator, must not exceed 255 (wide) characters.
            if (mb_strlen($line) > Gedcom::LINE_LENGTH) {
                [$level, $tag] = explode(' ', $line, 3);
                if ($tag !== 'CONT' && $tag !== 'CONC') {
                    $level++;
                }
                do {
                    // Split after $pos chars
                    $pos = Gedcom::LINE_LENGTH;
                    // Split on a non-space (standard gedcom behaviour)
                    while (mb_substr($line, $pos - 1, 1) === ' ') {
                        --$pos;
                    }
                    if ($pos === strpos($line, ' ', 3)) {
                        // No non-spaces in the data! Can’t split it :-(
                        break;
                    }
                    $newrec .= mb_substr($line, 0, $pos) . Gedcom::EOL;
                    $line   = $level . ' CONC ' . mb_substr($line, $pos);
                } while (mb_strlen($line) > Gedcom::LINE_LENGTH);
            }
            $newrec .= $line . Gedcom::EOL;
        }

        return $newrec;
    }
80436
public function description() {
		$output = null;
		if ( ! empty( $this->struct['description'] ) ) {
			$output .= ' <small>' . esc_html( $this->struct['description'] ) . '</small>';
		}

		return $output;
	}
510053
public function renderStraight($container = null)
    {
        $this->parseContainer($container);
        if (null === $container) {
            $container = $this->getContainer();
        }

        if (! $active = $this->findActive($container)) {
            return '';
        }

        $active = $active['page'];
        $html = $this->htmlify($active);

        while ($parent = $active->getParent()) {
            if ($parent instanceof AbstractPage) {
                $html = $this->htmlify($parent, true).$html;
            }

            if ($parent === $container) {
                break;
            }

            $active = $parent;
        }

        return strlen($html) ? '<ol class="breadcrumb">'.$this->getIndent().$html.'</ol>' : '';
    }
805782
protected function render() : string
    {
        $html = '<div class="jumbotron' .
            (($this->fluid === true) ? ' jumbotron-fluid' : null) .
            (($this->bg_color !== null) ? ' bg-' . $this->bg_color : null) .
            (($this->text_color !== null) ? ' text-' . $this->text_color : null) .
            '">' .
            (($this->fluid === true) ? '<div class="container">' : null) .
            '<h1 class="display-' . (($this->display_level !== null) ? $this->display_level : '1') .
            '">' . $this->heading .
            (($this->sub_heading !== null) ? ' <small>' .
            $this->sub_heading . '</small>' : null) .
            '</h1>' . $this->content .
            (($this->fluid === true) ? '</div>' : null) .
            '</div>';

        return $html;
    }
912478
public function preView($output) {
        /** @var $purifierConfig \HTMLPurifier_Config */
        $purifierConfig = \HTMLPurifier_Config::createDefault();
        $purifierConfig->set('Core.Encoding', 'UTF-8');
        $purifierConfig->set('HTML.TidyLevel', 'medium');

        /** @var \HTMLPurifier_Config $purifierConfig */
        $purifier = new \HTMLPurifier($purifierConfig);
        $output   = $purifier->purify($output);

        return $output;
    }