handle <th> tags

@param void
@return void
351766
protected function handleTag_th()
    {
        if (!$this->keepHTML && !isset($this->table['rows'][1]) && !isset($this->table['aligns'][$this->col + 1])) {
            if (isset($this->parser->tagAttributes['align'])) {
                $this->table['aligns'][$this->col + 1] = $this->parser->tagAttributes['align'];
            } else {
                $this->table['aligns'][$this->col + 1] = '';
            }
        }
        $this->handleTag_td();
    }
368236
public function tbody(array $attributes = []): void
    {
        $this->tableArray[] = Tags::tbody($this->trArray, $attributes);
        $this->trArray = [];
    }
1282605
function handleTag_img() {
    if (!$this->parser->isStartTag) {
      return; # just to be sure this is really an empty tag...
    }

    if (isset($this->parser->tagAttributes['title'])) {
      $this->parser->tagAttributes['title'] = $this->decode($this->parser->tagAttributes['title']);
    } else {
      $this->parser->tagAttributes['title'] = null;
    }
    if (isset($this->parser->tagAttributes['alt'])) {
      $this->parser->tagAttributes['alt'] = $this->decode($this->parser->tagAttributes['alt']);
    } else {
      $this->parser->tagAttributes['alt'] = null;
    }

    if (empty($this->parser->tagAttributes['src'])) {
      # support for "empty" images... dunno if this is really needed
      # but there are some testcases which do that...
      if (!empty($this->parser->tagAttributes['title'])) {
        $this->parser->tagAttributes['title'] = ' '.$this->parser->tagAttributes['title'].' ';
      }
      $this->out('!['.$this->parser->tagAttributes['alt'].']('.$this->parser->tagAttributes['title'].')', true);
      return;
    } else {
      $this->parser->tagAttributes['src'] = $this->decode($this->parser->tagAttributes['src']);
    }

    # [This link][id]
    $link_id = false;
    if (!empty($this->stack['a'])) {
      foreach ($this->stack['a'] as $tag) {
        if ($tag['href'] == $this->parser->tagAttributes['src']
            && $tag['title'] === $this->parser->tagAttributes['title']) {
          $link_id = $tag['linkID'];
          break;
        }
      }
    } else {
      $this->stack['a'] = array();
    }
    if (!$link_id) {
      $link_id = count($this->stack['a']) + 1;
      $tag = array(
        'href' => $this->parser->tagAttributes['src'],
        'linkID' => $link_id,
        'title' => $this->parser->tagAttributes['title']
      );
      array_push($this->stack['a'], $tag);
    }

    $this->out('!['.$this->parser->tagAttributes['alt'].']['.$link_id.']', true);
  }
931772
public function handle()
    {
        $this->determineWhatShouldBePublished();

        foreach ($this->tags ?: [null] as $tag) {
            $this->publishTag($tag);
        }

        $this->info('Publishing complete.');
    }
180712
public function clearTag(string $tag): void
    {
        $keys = $this->getTagItems($tag);

        foreach ($keys as $key) {
            $this->unlink($key);
        }

        $this->rm($this->getTagKey($tag));
    }
925146
public function untag($tags = null)
    {
        if ($tags === null) {
            $this->removeAllTags();

            return;
        }

        $this->removeTags(
            $this->getWorkableTags($tags)
        );
    }
118310
public function td(string $text = '', array $attributes = []): void
    {
        $this->tdArray[] = Tags::td($text, $attributes);
    }
202858
public function setTags($tags)
    {
        $this->_tags = $tags;
        $this->_tagsDirty = true;
        $this->_currentTags = null;
    }
951969
protected function initTag()
    {
        $this->tagName = $this->definition->getTag();

        $description = trim($this->definition->getDescription());
        if ($description !== '') {
            $this->description = trim($this->definition->getDescription());
        }
    }
553273
protected function handleTag_li()
    {
        if ($this->parent() == 'ol') {
            $parent =& $this->getStacked('ol');
            if ($this->parser->isStartTag) {
                $parent['num']++;
                $this->out(str_repeat(' ', 3 - strlen($parent['num'])) . $parent['num'] . '. ', true);
            }
        } else {
            if ($this->parser->isStartTag) {
                $this->out('  * ', true);
            }
        }
        $this->indent('    ', false);
        if (!$this->parser->isStartTag) {
            $this->setLineBreaks(1);
        }
    }
1086367
public function hooks()
    {
        $this->hook->action(
            $this->isAllowedArea($this->getArea()),
            [$this, 'handleAction']
        )->dispatch();

        if (! empty($this->getArgument('execution'))) {
            $this->hook->filter(
                'script_loader_tag',
                [$this, 'addExecutionTypes']
            )->dispatch();
        }
    }
302453
protected function handleTag_img()
    {
        if (!$this->parser->isStartTag) {
            return; // just to be sure this is really an empty tag...
        }

        if (isset($this->parser->tagAttributes['title'])) {
            $this->parser->tagAttributes['title'] = $this->decode($this->parser->tagAttributes['title']);
        } else {
            $this->parser->tagAttributes['title'] = null;
        }
        if (isset($this->parser->tagAttributes['alt'])) {
            $this->parser->tagAttributes['alt'] = $this->decode($this->parser->tagAttributes['alt']);
        } else {
            $this->parser->tagAttributes['alt'] = null;
        }

        if (empty($this->parser->tagAttributes['src'])) {
            // support for "empty" images... dunno if this is really needed
            // but there are some test cases which do that...
            if (!empty($this->parser->tagAttributes['title'])) {
                $this->parser->tagAttributes['title'] = ' ' . $this->parser->tagAttributes['title'] . ' ';
            }
            $this->out('![' . $this->parser->tagAttributes['alt'] . '](' . $this->parser->tagAttributes['title'] . ')', true);

            return;
        } else {
            $this->parser->tagAttributes['src'] = $this->decode($this->parser->tagAttributes['src']);
        }

        $out = '![' . $this->parser->tagAttributes['alt'] . ']';
        if ($this->linkPosition == self::LINK_IN_PARAGRAPH) {
            $out .= '(' . $this->parser->tagAttributes['src'];
            if ($this->parser->tagAttributes['title']) {
                $out .= ' "' . $this->parser->tagAttributes['title'] . '"';
            }
            $out .= ')';
            $this->out($out, true);
            return;
        }

        // ![This image][id]
        $link_id = false;
        if (!empty($this->footnotes)) {
            foreach ($this->footnotes as $tag) {
                if ($tag['href'] == $this->parser->tagAttributes['src']
                    && $tag['title'] === $this->parser->tagAttributes['title']
                ) {
                    $link_id = $tag['linkID'];
                    break;
                }
            }
        }
        if (!$link_id) {
            $link_id = count($this->footnotes) + 1;
            $tag = [
                'href' => $this->parser->tagAttributes['src'],
                'linkID' => $link_id,
                'title' => $this->parser->tagAttributes['title']
            ];
            array_push($this->footnotes, $tag);
        }
        $out .= '[' . $link_id . ']';

        $this->out($out, true);
    }
1303088
protected function handleItself()
    {
        if ($this->isMoved($this->event)) {
            if ($this->getResource()->exists() && $this->addWatch() === $this->id) {
                return;
            }

            $this->unwatch($this->id);
        }

        if ($this->getResource()->exists()) {
            if ($this->isIgnored($this->event) || $this->isMoved($this->event) || !$this->id) {
                $this->setEvent($this->id ? IN_MODIFY : IN_CREATE);
                $this->watch();
            }
        } elseif ($this->id) {
            $this->event = IN_DELETE;
            $this->getBag()->remove($this);
            $this->unwatch($this->id);
            $this->id = null;
        }
    }
1283025
public function flushByTag($tag)
    {
        if ($this->freeze) {
            throw new \Exception('Backend is frozen!', 123789);
        }
        $identifiers = $this->findIdentifiersByTag($tag);
        foreach ($identifiers as $identifier) {
            $this->remove($identifier);
        }
    }
822412
function clean($tag) {
		if (isset($this->_tags[$tag])) {
			foreach ($this->_tags[$tag] as $k) { /** @var string $k */
				unset($this->_data[$k]);
			}
			unset($this->_tags[$tag]);
		}
	}
113748
protected function processTags()
	{
		if (empty($this->tagStack))
		{
			return;
		}

		// Initialize the count tables
		foreach (array_keys($this->tagsConfig) as $tagName)
		{
			$this->cntOpen[$tagName]  = 0;
			$this->cntTotal[$tagName] = 0;
		}

		// Process the tag stack, close tags that were left open and repeat until done
		do
		{
			while (!empty($this->tagStack))
			{
				if (!$this->tagStackIsSorted)
				{
					$this->sortTags();
				}

				$this->currentTag = array_pop($this->tagStack);
				$this->processCurrentTag();
			}

			// Close tags that were left open
			foreach ($this->openTags as $startTag)
			{
				// NOTE: we add tags in hierarchical order (ancestors to descendants) but since
				//       the stack is processed in LIFO order, it means that tags get closed in
				//       the correct order, from descendants to ancestors
				$this->addMagicEndTag($startTag, $this->textLen);
			}
		}
		while (!empty($this->tagStack));
	}
38329
public function handle(ApplyTagCommand $command)
    {
        Taggable::firstOrCreate([
            'tag_id'        => $command->tag->id,
            'taggable_id'   => $command->model->id,
            'taggable_type' => $command->model->getTable(),
        ]);
    }