Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 10, 2023
1 parent e82a144 commit c5e55fa
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Latte/Compiler/TemplateParserHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private function parseElement(): Node
if ($this->isClosingTag($elem->name)) {
$elem->content = $content;
$elem->content->append($this->extractIndentation());
$this->parseTag();
$this->parseElementEndTag();

} elseif ($outerNodes || $innerNodes || $tagNodes
|| ($this->parser->getContentType() === ContentType::Html && in_array(strtolower($elem->name), ['script', 'style'], true))
Expand Down Expand Up @@ -213,6 +213,19 @@ private function parseBogusTag(): Html\BogusTagNode
}


private function parseElementEndTag(): void
{
$stream = $this->parser->getStream();
$stream->consume(Token::Html_TagOpen);
$stream->consume(Token::Slash);
$stream->consume(Token::Html_Name);
$this->parser->location = $this->parser::LocationTag;
$this->parser->parseFragment([$this, 'inTagResolve']);
$this->parser->location = $this->parser::LocationText;
$stream->consume(Token::Html_TagClose);
}


private function resolveVoidness(Html\ElementNode $elem): bool
{
if ($this->parser->getContentType() !== ContentType::Html) {
Expand Down

0 comments on commit c5e55fa

Please sign in to comment.