handle <a> tags

@param void
@return void
343204
function handleTag_a() {
    if ($this->parser->isStartTag) {
      $this->buffer();
      if (isset($this->parser->tagAttributes['title'])) {
        $this->parser->tagAttributes['title'] = $this->decode($this->parser->tagAttributes['title']);
      } else {
        $this->parser->tagAttributes['title'] = null;
      }
      $this->parser->tagAttributes['href'] = $this->decode(trim($this->parser->tagAttributes['href']));
      $this->stack();
    } else {
      $tag = $this->unstack();
      $buffer = $this->unbuffer();

      if (empty($tag['href']) && empty($tag['title'])) {
        # empty links... testcase mania, who would possibly do anything like that?!
        $this->out('['.$buffer.']()', true);
        return;
      }

      if ($buffer == $tag['href'] && empty($tag['title'])) {
        # <http://example.com>
        $this->out('<'.$buffer.'>', true);
        return;
      }

      $bufferDecoded = $this->decode(trim($buffer));
      if (substr($tag['href'], 0, 7) == 'mailto:' && 'mailto:'.$bufferDecoded == $tag['href']) {
        if (is_null($tag['title'])) {
          # <mail@example.com>
          $this->out('<'.$bufferDecoded.'>', true);
          return;
        }
        # [mail@example.com][1]
        # ...
        #  [1]: mailto:mail@example.com Title
        $tag['href'] = 'mailto:'.$bufferDecoded;
      }
	    if ($this->linksAfterEachParagraph!=='inline'){
	      # [This link][id]
	      foreach ($this->stack['a'] as $tag2) {
	        if ($tag2['href'] == $tag['href'] && $tag2['title'] === $tag['title']) {
	          $tag['linkID'] = $tag2['linkID'];
	          break;
	        }
	      }
	      if (!isset($tag['linkID'])) {
	        $tag['linkID'] = count($this->stack['a']) + 1;
	        array_push($this->stack['a'], $tag);
	      }

	      $this->out('['.trim($buffer).']['.$tag['linkID'].']', true);
	    }
	    else {
		    # [This link|title](url)
		    if ($tag['title'])
			    $buffer.="|".$tag['title'];
		    $this->out('['.trim($buffer).']('.$tag['href'].')', true);
	    }
    }
  }
999279
public function setTagsAttribute($tags): void
    {
        static::saved(function (self $model) use ($tags) {
            $model->syncTags($tags);
        });
    }
297509
protected function setActionTags()
    {
        $form = $this->xml->getElementsByTagName('form')->item(0);
        $div = $this->xml->createElement('div');

        $input = $this->xml->createElement('input');
        $input->setAttribute('type', 'hidden');
        $input->setAttribute('name', 'ext');
        $input->setAttribute('value', $this->owner->name);
        $div->appendChild($input);

        $input = $this->xml->createElement('input');
        $input->setAttribute('type', 'hidden');
        $input->setAttribute('name', 'form');
        $input->setAttribute('value', $this->name);
        $div->appendChild($input);

        $form->appendChild($div);
    }
237291
protected function handleHeader($level)
    {
        if ($this->parser->isStartTag) {
            $this->parser->tagAttributes['cssSelector'] = $this->getCurrentCssSelector();
            $this->stack();
        } else {
            $tag = $this->unstack();
            if (!empty($tag['cssSelector'])) {
                // {#id.class}
                $this->out(' {' . $tag['cssSelector'] . '}');
            }
        }
        parent::handleHeader($level);
    }
488227
public function taggedAs($tag)
    {
        if (empty($this->current_node)) {
            return;
        }

        $this->current_node->tags = $tag;
        $this->current_node->save();
    }
1149181
public function execute()
    {
        switch ($this->called) {
        case 'textarea':
            $Tag = new HTML\Tag($this->called, array($this->args[0], $this->args[1]), array('generate', 'inlineInner'));
            break;
        default:
            $Tag = new HTML\Tag($this->called, array($this->args[0]), array('generate'));
            break;
        }

        if ($this->called == 'checkbox' && isset($this->args[2])
            && ($this->args[2] === true || $this->args[2] === 'on' || $this->args[2] === 1
                || $this->args[2] === $Tag->attributes['id']
                || (is_array($this->args[2]) && in_array($Tag->attributes['id'], $this->args[2]))
            )
        ) {
            $Tag->setAttrs(array('checked' => null));
        }

        if ($this->_label !== false) {
            $Label = HTML\Generator::getLabel($this->_label, $Tag);

            HTML\Generator::appendLabel($Label, $Tag, $this->_label);
        } else {
            echo $Tag;
        }
    }
1284007
public function addTags($tags = array())
	{
		if (!is_array($tags)) {
			$tags = func_get_args();
		}
		foreach ($tags as $tagAttributes) {
			$this->addTag($tagAttributes);
		}
	}
931772
public function handle()
    {
        $this->determineWhatShouldBePublished();

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

        $this->info('Publishing complete.');
    }
498363
protected function setTagItem(string $name): void
    {
        if (!empty($this->tag)) {
            foreach ($this->tag as $tag) {
                $tagName = $this->getTagKey($tag);
                $this->handler->sAdd($tagName, $name);
            }

            $this->tag = null;
        }
    }
275121
public function run()
	{
		$this->renderContent();
		$content=ob_get_clean();
		if($this->hideOnEmpty && trim($content)==='')
			return;
		echo $this->_openTag;
		echo $content;
		echo "</div>\n";
		echo CHtml::closeTag($this->tagName);
	}
748652
public function handle($e) {
            $this->injectCSS();
            self::$lastReported = $e;

            if ($this->isCLI) {
                $this->handleCLI($e);
            } else {
                $this->handleHTML($e);
            }

            $this->log($e);
        }
335372
function _handleTags(username, tags, cb) {
    var self = this;

    self.userData = tags;
    self.userData.username = username;
    self.userData.special = [];

    if (typeof tags['emotes'] === 'string') {
        var emoticons = tags['emotes'].split('/');
        var emotes = {};

        for (var i = 0; i < emoticons.length; i++) {
            var parts = emoticons[i].split(':');
            emotes[parts[0]] = parts[1].split(',');
        }
        self.userData.emote = emotes;
    }

    if (tags['subscriber'] === '1') { self.userData.special.push('subscriber'); }
    if (tags['turbo'] === '1') { self.userData.special.push('turbo'); }
    if (typeof tags['user_type'] === 'string') { self.userData.special.push(tags['user_type']); }

    if (typeof cb == "function") {
        return cb(self.userData);
    }
}
502909
public function setTags($tags)
    {
        foreach ($tags as $key => $value) {
            $this->setTag($key, $value);
        }
    }
343127
protected function handleTag_a_converter($tag, $buffer)
    {
        $output = parent::handleTag_a_converter($tag, $buffer);
        if (!empty($tag['cssSelector'])) {
            // [This link][id]{#id.class}
            $output .= '{' . $tag['cssSelector'] . '}';
        }

        return $output;
    }
753236
protected function handleArrayAnnotation(array $varTags)
    {
        foreach ($varTags as $key => $tag) {
            if ('[]' === substr($tag, -2)) {
                $class = substr($tag, 0, -2);

                if (Core::get()->classExists($class)) {
                    $varTags[$key] = "\\ArrayObject<$class>";
                }
            }
        }

        return $varTags;
    }
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]);
		}
	}
1362545
public function tr(array $attributes = []): void
    {
        $this->trArray[] = Tags::tr($this->tdArray, $attributes);
        $this->tdArray = [];
    }