Builds an array of classes by seperating the class attribute by spaces
If if was not build before

If the classes array exists the attributes class will be updates

@param Tag &$Tag the current Tag

@return void
198645
public static function updateClasses(Tag &$Tag)
    {
        if (empty($Tag->classes) && isset($Tag->attributes['class'])) {
            $classes = explode(' ', $Tag->attributes['class']);
        } elseif (!empty($Tag->classes)) {
            $classes = $Tag->classes;
        }

        if (isset($classes)) {
            sort($classes);
            $Tag->classes = $classes;
            $Tag->attributes['class'] = implode(' ', $classes);
        }
    }
1241963
public function thead(array $attributes = []): void
    {
        $this->tableArray[] = Tags::thead($this->trArray, $attributes);
        $this->trArray = [];
    }
310963
public function colgroup(array $attributes = []): void
    {
        $this->tableArray[] = Tags::colgroup($this->colArray, $attributes);
        $this->colArray = [];
    }
17310
public static function addTags($tags)
    {
        self::updateAllCounters(['frequency' => 1], ['name' => $tags]);

        foreach ($tags as $name) {
            if (!self::find()->where(['name' => $name])->exists()) {
                (new self([
                    'name' => $name,
                    'frequency' => 1
                ]))->save();
            }
        }
    }
1207705
public static function executeAttributePreprocessors(Tag $tag, array $tagConfig)
	{
		if (empty($tagConfig['attributePreprocessors']))
		{
			return;
		}

		foreach ($tagConfig['attributePreprocessors'] as list($attrName, $regexp, $map))
		{
			if ($tag->hasAttribute($attrName))
			{
				self::executeAttributePreprocessor($tag, $attrName, $regexp, $map);
			}
		}
	}
999279
public function setTagsAttribute($tags): void
    {
        static::saved(function (self $model) use ($tags) {
            $model->syncTags($tags);
        });
    }
434969
protected function insertTag(Tag $tag)
	{
		if (!$this->tagStackIsSorted)
		{
			$this->tagStack[] = $tag;
		}
		else
		{
			// Scan the stack and copy every tag to the next slot until we find the correct index
			$i = count($this->tagStack);
			while ($i > 0 && self::compareTags($this->tagStack[$i - 1], $tag) > 0)
			{
				$this->tagStack[$i] = $this->tagStack[$i - 1];
				--$i;
			}
			$this->tagStack[$i] = $tag;
		}
	}
133599
public function configDefaults($tag)
    {
        if (count(config('html.default.'.$tag, []))) {
            foreach (config('html.default.'.$tag) as $name => $value) {
                $this->attr($name, $value);
            }
        }
    }
1191801
public function deleteByTags($tag)
    {
        if (!isset($this->tags[$tag])) {
            return false;
        }

        foreach ($this->tags[$tag] as $key) {
            $this->delete($key);
        }

        return true;
    }
135513
public function addTag($tagAttributes = array())
	{
		if (is_string($tagAttributes)) {
			$tagAttributes = array('tag' => $tagAttributes);
		}
		$tagAttributes['tag'] = $this->formatTag($tagAttributes['tag']);
		if (!array_key_exists('size', $tagAttributes)) {
			$tagAttributes = array_merge($tagAttributes, array('size' => 1));
		}
		if (!array_key_exists('tag', $tagAttributes)) {
			return false;
		}
		$tag = $tagAttributes['tag'];
		if (empty($this->_tagsArray[$tag])) {
			$this->_tagsArray[$tag] = array();
		}
		if (!empty($this->_tagsArray[$tag]['size']) && !empty($tagAttributes['size'])) {
			$tagAttributes['size'] = ($this->_tagsArray[$tag]['size'] + $tagAttributes['size']);
		} elseif (!empty($this->_tagsArray[$tag]['size'])) {
			$tagAttributes['size'] = $this->_tagsArray[$tag]['size'];
		}
		$this->_tagsArray[$tag] = $tagAttributes;
		//$this->addAttributes($tagAttributes);
		return $this->_tagsArray[$tag];
	}
757334
public function addTag(Tag $tag)
    {
        $tag->setBlog($this);
        $this->tags->add($tag);

        return $tag;
    }
451156
public static function addDoubleAttributes(Tag &$Tag)
    {
        if (isset(TagInfo::$doubleAttrs[$Tag->name])) {
            $missing = array();
            $found = '';
            foreach (TagInfo::$doubleAttrs[$Tag->name] as $k => $name) {
                if ($k === '%callback') {
                    $callback = $name;
                    continue;
                }
                if (isset($Tag->attributes[$name])) {
                    $found = $Tag->attributes[$name];
                } else {
                    $missing[] = $name;
                }
            }
            if (empty($found) || empty($missing)) {
                return;
            }
            foreach ($missing as $k) {
                $Tag->attributes[$k] = $found;
            }

            if (count($missing) && isset($callback) && is_callable($callback)) {
                call_user_func_array($callback, array(&$Tag, $missing));
            }
        }
    }
829854
public function addTag(Tag $tag)
    {
        if (!$this->tags->contains($tag)) {
            $this->tags->add($tag);
            return true;
        }
        return false;
    }
789142
public function tag($tag, $content, array $attributes = [])
    {
        return $this->htmlBuilder->tag($tag, $content, $attributes);
    }
487594
public function normalizeTag(Tag $tag)
	{
		if (isset($tag->template) && !$tag->template->isNormalized())
		{
			$tag->template->normalize($this);
		}
	}
1309587
function addClasses(element, classNames) {

  var classes = domClasses(element);

  var actualClassNames = isArray(classNames) ? classNames : classNames.split(/\s+/g);
  actualClassNames.forEach(function(cls) {
    classes.add(cls);
  });
}
126375
private function replaceClassInTags(Definition $definition, $tagName, $class): void
    {
        $tags = $definition->getTag($tagName);

        $definition->clearTag($tagName);

        foreach ($tags as &$tag) {
            if (isset($tag['class'])) {
                $tag['class'] = $class;
            }

            $definition->addTag($tagName, $tag);
        }
    }