Skip to content

Commit

Permalink
Updated s9e\TextFormatter
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Dec 27, 2016
1 parent 891f187 commit 287761a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bundle.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "phpbb-extension",
"description": "Embed third-party content in your phpBB forum",
"homepage": "https://github.com/s9e/phpbb-ext-mediaembed/",
"version": "20161115",
"version": "20161227",
"keywords": ["phpbb","embed","forum","media"],
"license": "MIT",
"require": {
Expand Down
17 changes: 8 additions & 9 deletions parsing.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,6 @@ protected function processTags()
if (!$this->tagStackIsSorted)
$this->sortTags();
$this->currentTag = \array_pop($this->tagStack);
if ($this->context['flags'] & self::RULE_IGNORE_TAGS)
if (!$this->currentTag->canClose(\end($this->openTags))
&& !$this->currentTag->isSystemTag())
continue;
$this->processCurrentTag();
}
foreach ($this->openTags as $startTag)
Expand All @@ -699,11 +695,13 @@ protected function processTags()
}
protected function processCurrentTag()
{
if ($this->currentTag->isInvalid())
return;
if (($this->context['flags'] & self::RULE_IGNORE_TAGS)
&& !$this->currentTag->canClose(\end($this->openTags))
&& !$this->currentTag->isSystemTag())
$this->currentTag->invalidate();
$tagPos = $this->currentTag->getPos();
$tagLen = $this->currentTag->getLen();
if ($this->pos > $tagPos)
if ($this->pos > $tagPos && !$this->currentTag->isInvalid())
{
$startTag = $this->currentTag->getStartTag();
if ($startTag && \in_array($startTag, $this->openTags, \true))
Expand All @@ -725,8 +723,9 @@ protected function processCurrentTag()
}
}
$this->currentTag->invalidate();
return;
}
if ($this->currentTag->isInvalid())
return;
if ($this->currentTag->isIgnoreTag())
$this->outputIgnoreTag($this->currentTag);
elseif ($this->currentTag->isBrTag())
Expand Down Expand Up @@ -999,7 +998,7 @@ protected function insertTag(Tag $tag)
}
public function addTagPair($name, $startPos, $startLen, $endPos, $endLen, $prio = 0)
{
$endTag = $this->addEndTag($name, $endPos, $endLen);
$endTag = $this->addEndTag($name, $endPos, $endLen, -$prio);
$startTag = $this->addStartTag($name, $startPos, $startLen, $prio);
$startTag->pairWith($endTag);
return $startTag;
Expand Down
4 changes: 2 additions & 2 deletions rendering.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"stable":{"20161115":{"current":"20161115","announcement":"https:\/\/www.phpbb.com\/community\/viewtopic.php?f=456&t=2272431","download":"https:\/\/github.com\/s9e\/phpbb-ext-mediaembed\/releases\/download\/20161115\/s9e-mediaembed-20161115.zip","eol":null,"security":false}}}
{"stable":{"20161227":{"current":"20161227","announcement":"https:\/\/www.phpbb.com\/community\/viewtopic.php?f=456&t=2272431","download":"https:\/\/github.com\/s9e\/phpbb-ext-mediaembed\/releases\/download\/20161227\/s9e-mediaembed-20161227.zip","eol":null,"security":false}}}

0 comments on commit 287761a

Please sign in to comment.