Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 12, 2023
1 parent 40eb68f commit bf3a5d9
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 bf3a5d9

Please sign in to comment.