Navigation Menu

Skip to content

Commit

Permalink
minor #22455 [VarDumper] Minor tweaks to html/css dumps (nicolas-grekas)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.2 branch.

Discussion
----------

[VarDumper] Minor tweaks to html/css dumps

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes (minor/DX)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

3b83fe1 [VarDumper] Minor tweaks to html/css dumps
  • Loading branch information
nicolas-grekas committed Apr 18, 2017
2 parents 3d9ad54 + 3b83fe1 commit c9a614e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Expand Up @@ -64,6 +64,7 @@ a.doc:hover {

.anchor {
position: relative;
top: -7em;
padding-top: 7em;
margin-top: -7em;
visibility: hidden;
}
2 changes: 1 addition & 1 deletion src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php
Expand Up @@ -496,7 +496,7 @@ protected function style($style, $value, $attr = array())
$attr['href'] = $href;
}
if (isset($attr['href'])) {
$v = sprintf('<a href="%s">%s</a>', esc($this->utf8Encode($attr['href'])), $v);
$v = sprintf('<a href="%s" target="_blank" rel="noopener noreferrer">%s</a>', esc($this->utf8Encode($attr['href'])), $v);
}
if (isset($attr['lang'])) {
$v = sprintf('<code class="%s">%s</code>', esc($attr['lang']), $v);
Expand Down
Expand Up @@ -100,7 +100,7 @@ public function testLinkStub()

$expectedDump = <<<'EODUMP'
<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp>
<span class=sf-dump-index>0</span> => "<a href="%sStubCasterTest.php:0"><span class=sf-dump-str title="55 characters">Symfony\Component\VarDumper\Tests\Caster\StubCasterTest</span></a>"
<span class=sf-dump-index>0</span> => "<a href="%sStubCasterTest.php:0" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="55 characters">Symfony\Component\VarDumper\Tests\Caster\StubCasterTest</span></a>"
</samp>]
</bar>
EODUMP;
Expand All @@ -120,7 +120,7 @@ public function testClassStub()

$expectedDump = <<<'EODUMP'
<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp>
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:10"><span class=sf-dump-str title="5 characters">hello</span></a>"
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:10" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>"
</samp>]
</bar>
EODUMP;
Expand Down Expand Up @@ -161,7 +161,7 @@ public function testClassStubWithNotExistingMethod()

$expectedDump = <<<'EODUMP'
<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp>
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:5"><span class=sf-dump-str title="5 characters">hello</span></a>"
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:5" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>"
</samp>]
</bar>
EODUMP;
Expand Down

0 comments on commit c9a614e

Please sign in to comment.