Open mawi12345 opened 10 years ago
Thank you for taking your time. I checked the passed arguments to processBlockQuote and found a problem. I'm looking for a way to solve this.
/**
* @param Text $text
*/
public function processBlockQuote(Text $text, array $options = array(), $level = 1)
{
$args = func_get_args();
var_dump($args);
/...
$ bin/ciconia test.md
input:
> test
> > test
> > test
> > > test
> > > test
output:
array(2) {
[0] =>
class Ciconia\Common\Text#68 (1) {
private $text =>
string(50) "> test\n> > test\n> > test\n> > > test\n> > > test\n\n\n\n"
}
[1] =>
array(3) {
'tabWidth' =>
int(4)
'nestedTagLevel' =>
int(3)
'strict' =>
bool(false)
}
}
array(4) {
[0] =>
class Ciconia\Common\Text#76 (1) {
private $text =>
string(40) "test\n> test\n> test\n> > test\n> > test\n\n\n\n"
}
[1] =>
array(3) {
'tabWidth' =>
int(4)
'nestedTagLevel' =>
int(3)
'strict' =>
bool(false)
}
[2] =>
int(2)
[3] =>
array(3) {
'tabWidth' =>
int(4)
'nestedTagLevel' =>
int(3)
'strict' =>
bool(false)
}
}
array(4) {
[0] =>
class Ciconia\Common\Text#79 (1) {
private $text =>
string(27) "test\ntest\n> test\n> test\n\n\n\n"
}
[1] =>
array(3) {
'tabWidth' =>
int(4)
'nestedTagLevel' =>
int(3)
'strict' =>
bool(false)
}
[2] =>
int(3)
[3] =>
array(3) {
'tabWidth' =>
int(4)
'nestedTagLevel' =>
int(3)
'strict' =>
bool(false)
}
}
array(4) {
[0] =>
class Ciconia\Common\Text#82 (1) {
private $text =>
string(13) "test\ntest\n\n\n\n"
}
[1] =>
array(3) {
'tabWidth' =>
int(4)
'nestedTagLevel' =>
int(3)
'strict' =>
bool(false)
}
[2] =>
int(4)
[3] =>
array(3) {
'tabWidth' =>
int(4)
'nestedTagLevel' =>
int(3)
'strict' =>
bool(false)
}
}
<blockquote>
<p>test</p>
<blockquote>
<p>test
test</p>
<blockquote>
<p>test
test</p>
</blockquote>
</blockquote>
</blockquote>%
Thank you for your quick response. I have added an block quote extensions unit test. In my use case the extension works great. I suppose you expect level 1 on all nested quotes?
level 1: No probrem.
level 2+: $options
passed as 2nd and 4th argument is duplicated.
I want to solve this. I think the probrem is https://github.com/kzykhys/Ciconia/blob/master/src/Ciconia/Markdown.php#L133.
:+1:
Some render may need the level of the block quote.