Jumbotron::createParagraph

@param string|null  $text
@param array        $attributes

@return Paragraph
5334
public function createParagraph($text = null, array $attributes = [])
    {
        $paragraph = new Paragraph();

        if (count($attributes)) {
            foreach ($attributes as $name => $value) {
                $paragraph->attributes->addAttribute($name, $value);
            }
        }

        if ($text instanceof Element) {
            $paragraph->childNodes->push($text);
        } elseif ( ! is_null($text)) {
            $paragraph->textContent->push($text);
        }

        $this->childNodes->push($paragraph);

        return $this->childNodes->last();
    }
1082071
public static function createElement($tag = '', $attributes1 = [], $attributes2 = [])
    {
        $tag_object = parent::createElement($tag);
        $tag_object->setTag($tag);
        $attributes = $attributes1;
        if (!is_array($attributes1) && strlen($attributes1) > 0) {
            $tag_object->text($attributes1);
            $attributes = $attributes2;
        }
        if (is_array($attributes)) {
            foreach ($attributes as $name => $value) {
                if (method_exists($tag_object, $name)) {
                    if (!is_array($value)) {
                        $value = [$value];
                    }
                    call_user_func_array([$tag_object, $name], $value);
                }
            }
        }

        $tag_object->configDefaults($tag);

        return $tag_object;
    }
162906
public static function nl2paragraph($text)
    {
        $paragraphs = explode("\n", $text);

        foreach ($paragraphs as &$paragraph) {
            $paragraph = "<p>$paragraph</p>";
        }

        return implode('', $paragraphs);
    }
1145973
function parse($text) {
		$text=parent::parse($text);
		// Build tree structure
		for ($ptr=0,$w=5,$len=strlen($text),$tree=[],$tmp='';$ptr<$len;)
			if (preg_match('/^(.{0,'.$w.'}?)<(\/?)(?:F3:)?'.
				'('.$this->tags.')\b((?:\s+[\w.:@!-]+'.
				'(?:\h*=\h*(?:"(?:.*?)"|\'(?:.*?)\'))?|'.
				'\h*\{\{.+?\}\})*)\h*(\/?)>/is',
				substr($text,$ptr),$match)) {
				if (strlen($tmp) || $match[1])
					$tree[]=$tmp.$match[1];
				// Element node
				if ($match[2]) {
					// Find matching start tag
					$stack=[];
					for($i=count($tree)-1;$i>=0;$i--) {
						$item=$tree[$i];
						if (is_array($item) &&
							array_key_exists($match[3],$item) &&
							!isset($item[$match[3]][0])) {
							// Start tag found
							$tree[$i][$match[3]]+=array_reverse($stack);
							$tree=array_slice($tree,0,$i+1);
							break;
						}
						else $stack[]=$item;
					}
				}
				else {
					// Start tag
					$node=&$tree[][$match[3]];
					$node=[];
					if ($match[4]) {
						// Process attributes
						preg_match_all(
							'/(?:(\{\{.+?\}\})|([^\s\/"\'=]+))'.
							'\h*(?:=\h*(?:"(.*?)"|\'(.*?)\'))?/s',
							$match[4],$attr,PREG_SET_ORDER);
						foreach ($attr as $kv)
							if (!empty($kv[1]) && !isset($kv[3]) && !isset($kv[4]))
								$node['@attrib'][]=$kv[1];
							else
								$node['@attrib'][$kv[1]?:$kv[2]]=
									(isset($kv[3]) && $kv[3]!==''?
										$kv[3]:
										(isset($kv[4]) && $kv[4]!==''?
											$kv[4]:NULL));
					}
				}
				$tmp='';
				$ptr+=strlen($match[0]);
				$w=5;
			}
			else {
				// Text node
				$tmp.=substr($text,$ptr,$w);
				$ptr+=$w;
				if ($w<50)
					$w++;
			}
		if (strlen($tmp))
			// Append trailing text
			$tree[]=$tmp;
		// Break references
		unset($node);
		return $tree;
	}
1354038
public function decorateHtmlTag($tag, array $attributes)
	{
		if (! $tag instanceof HtmlTag) {
			return null;
		}

		foreach ($attributes as $name => $value) {
			$tag->setAttribute($name, $value);
		}

		return $tag;
	}
169915
public function text($name, $value = null, array $attributes = array(), array $extra = array())
    {
        return $this->build('text', $name, $value, $attributes, $extra);
    }
703729
public static function link($text, $link = '#', array $attributes = array())
    {
        if (!is_null($link)) {
            $attributes['href'] = $link;
        }

        $node = new Node\Link($text);
        return $node->render($attributes);
    }
1165308
public function caption(string $text = '', array $attributes = []): void
    {
        if (\count($this->tableArray) == 0) {
            $this->tableArray[] = Tags::caption($text, $attributes);
        }
    }
1096913
public function createElement(array $attributes)
    {
        $element = $this->ownerDocument->createElement($this->element);

        $name = null;
        foreach ($attributes as $key => $value) {
            $element->setAttribute($key, $value);
        }

        $this[] = $element;

        return $element;
    }
822263
public function createHelp($text = null, $tagName = 'span')
    {
        $help = new Group\Help($tagName);

        if (isset($text)) {
            $help->textContent->push($text);
        }

        $this->childNodes->push($help);

        return $this->help = $this->childNodes->last();
    }
429889
public static function text($name, $value, array $attributes = array())
    {
        $node = new Node\Text();

        if (!is_null($name)) {
            $attributes['name'] = $name;
        }

        if (!is_null($value)) {
            $attributes['value'] = $value;
        }

        return $node->render($attributes);
    }
1028948
public function label($for, $text = null, $attributes = null)
    {
        return '<label for="'.$name.'" '.(($attributes !== null) ? $this->attributes($attributes) : "").' />'.$text.'</label>';
    }
1079678
public function text($name, $value = null, array $attributes = [])
    {
        $value = $this->getDefaultValue($name, $value);
        return $this->input('text', $name, $value, $attributes);
    }
816522
public function addTitleAddon($text, array $attributes = array())
    {
        $backlink_text                  = $this->_getConfigOrDefault('backlink_text');
        $backlink_attributes            = array();
        $backlink_attributes['title']   = '';

        // permalink links class
        $cfg_permalink_class            = $this->_getConfigOrDefault('permalink_class');
        if (isset($attributes['permalink_class'])) {
            $backlink_attributes['class'] = $attributes['permalink_class'];
            unset($attributes['permalink_class']);
        } else {
            $backlink_attributes['class'] = $cfg_permalink_class;
        }

        // toc backlink id
        $cfg_permalink_title            = $this->_getConfigOrDefault('permalink_mask_title');
        if (isset($attributes['id'])) {
            $backlink_attributes['href'] = '#'.$attributes['id'];

            if (isset($attributes['permalink_title'])) {
                $backlink_attributes['title'] .= $attributes['permalink_title'];
                unset($attributes['permalink_title']);

            } elseif (isset($attributes['permalink_mask_title'])) {
                $backlink_attributes['title'] .= str_replace('%%', '#'.$attributes['id'], $attributes['permalink_mask_title']);
                unset($attributes['permalink_mask_title']);

            } else {
                $backlink_attributes['title'] .= str_replace('%%', '#'.$attributes['id'], $cfg_permalink_title);
            }
        }

        // toc backlink id
        $cfg_toc_id                     = $this->_getConfigOrDefault('toc_id');
        $cfg_toc_title                  = $this->_getConfigOrDefault('toc_backlink_title');
        $cfg_backlink_onclick_mask      = $this->_getConfigOrDefault('backlink_onclick_mask');
        $cfg_permalink_title_separator  = $this->_getConfigOrDefault('permalink_title_separator');

        if (isset($attributes['permalink_title_separator'])) {
            $permalink_title_separator = $attributes['permalink_title_separator'];
            unset($attributes['permalink_title_separator']);
        } else {
            $permalink_title_separator = $cfg_permalink_title_separator;
        }

        if (isset($attributes['toc_id'])) {
            $toc_id = $attributes['toc_id'];
            unset($attributes['toc_id']);

            if (isset($attributes['toc_backlink_title'])) {
                $backlink_attributes['title'] .= $permalink_title_separator.$attributes['toc_backlink_title'];
                unset($attributes['toc_back_title']);
            } else {
                $backlink_attributes['title'] .= $permalink_title_separator.$cfg_toc_title;
            }

        } elseif (!empty($cfg_toc_id) && !empty($cfg_toc_title)) {
            $toc_id = $cfg_toc_id;
            $backlink_attributes['title'] .= $permalink_title_separator.$cfg_toc_title;
        }

        if (isset($attributes['backlink_onclick_mask'])) {
            $backlink_onclick_mask = $attributes['backlink_onclick_mask'];
            unset($attributes['backlink_onclick_mask']);
        } else {
            $backlink_onclick_mask = $cfg_backlink_onclick_mask;
        }
        $backlink_attributes['onclick'] = str_replace('%%', $toc_id, $backlink_onclick_mask);

        // add-on
        if (!empty($backlink_text) && !empty($backlink_attributes['title'])) {
            $text .= $this->buildTag('link', $backlink_text, $backlink_attributes);
        }

        return $text;
    }
325549
public function addParagraph($text)
    {
        $this->content .= isset($this->app)
            ? $this->app->getTag('p', $text)
            : '<p>'.htmlspecialchars($text).'</p>';

        return $this;
    }
118310
public function td(string $text = '', array $attributes = []): void
    {
        $this->tdArray[] = Tags::td($text, $attributes);
    }
277789
public static function option($value, $text, array $attributes = array())
    {
        if (!is_null($value)) {
            $attributes['value'] = $value;
        }

        $node = new Node\Option($text);
        return $node->render($attributes);
    }