Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add block quote level #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

add block quote level #14

wants to merge 2 commits into from

Conversation

mawi12345
Copy link

Some render may need the level of the block quote.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling a93b0d5 on mawi12345:master into b5521ed on kzykhys:master.

@kzykhys
Copy link
Owner

kzykhys commented Nov 28, 2013

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>%

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling b496716 on mawi12345:master into b5521ed on kzykhys:master.

@mawi12345
Copy link
Author

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?

@kzykhys
Copy link
Owner

kzykhys commented Nov 28, 2013

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.

@dereuromark
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants