Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tag inventory of Inigo renderer.
- Loading branch information
Showing
8 changed files
with
117 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Kaloa\Renderer\Inigo\Handler; | ||
|
||
use Kaloa\Renderer\Inigo\Handler\ProtoHandler; | ||
use Kaloa\Renderer\Inigo\Parser; | ||
|
||
/** | ||
* | ||
*/ | ||
final class QuoteHandler extends ProtoHandler | ||
{ | ||
/** | ||
* | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->name = 'quote'; | ||
$this->type = Parser::TAG_OUTLINE | Parser::TAG_FORCE_PARAGRAPHS; | ||
$this->defaultParam = 'author'; | ||
} | ||
|
||
/** | ||
* | ||
* @param array $data | ||
* @return string | ||
*/ | ||
public function draw(array $data) | ||
{ | ||
$ret = ''; | ||
|
||
if ($data['front']) { | ||
$author = $this->fillParam($data, 'author', ''); | ||
|
||
if ('' !== $author) { | ||
$ret .= '<p>' . $this->e($author) . ':</p>' . "\n\n"; | ||
} | ||
|
||
$ret .= '<blockquote>' . "\n"; | ||
} else { | ||
$ret .= '</blockquote>' . "\n\n"; | ||
} | ||
|
||
return $ret; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,8 @@ | |
|
||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<div style="text-align: center;">* * *</div> | ||
|
||
<p>Foo</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,7 @@ bar | |
|
||
[indent][h3]baz & boz[/h3][/indent] | ||
[/indent] | ||
|
||
[center]* * *[/center] | ||
|
||
Foo |
22 changes: 22 additions & 0 deletions
22
tests/Kaloa/Tests/Renderer/examples/inigo/quotations.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<p>Other text.</p> | ||
<blockquote> | ||
<p>This is a test</p> | ||
</blockquote> | ||
|
||
<p>Other text.</p> | ||
<blockquote> | ||
<p>This is another test.</p> | ||
|
||
<p>With two paragraphs.</p> | ||
</blockquote> | ||
|
||
<p>Other text.</p> | ||
<p>Foo & Bar:</p> | ||
|
||
<blockquote> | ||
<p>This is.</p> | ||
|
||
<p>A Test.</p> | ||
</blockquote> | ||
|
||
<p>Other text.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Other text. | ||
|
||
[quote]This is a test[/quote] | ||
|
||
Other text. | ||
|
||
[quote]This is another test. | ||
|
||
With two paragraphs.[/quote] | ||
|
||
Other text. | ||
|
||
[quote="Foo & Bar"]This is. | ||
|
||
A Test.[/quote] | ||
|
||
Other text. |