Fix recovered spaces calculation

This commit is contained in:
Aidan Woods 2019-02-02 21:07:53 +00:00
parent 117912c373
commit 54f2c4eb4c
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
3 changed files with 17 additions and 2 deletions

View File

@ -45,7 +45,7 @@ final class BlockQuote implements ContinuableBlock
$recoveredSpaces = 0; $recoveredSpaces = 0;
if (\strlen($matches[1]) === 2 && \substr($matches[1], 1, 1) === "\t") { if (\strlen($matches[1]) === 2 && \substr($matches[1], 1, 1) === "\t") {
$recoveredSpaces = Line::tabShortage(2, $Context->line()->indentOffset() + $Context->line()->indent()); $recoveredSpaces = Line::tabShortage(0, $indentOffset -1) -1;
} }
return new self(Lines::fromTextLines( return new self(Lines::fromTextLines(
@ -75,7 +75,7 @@ final class BlockQuote implements ContinuableBlock
$recoveredSpaces = 0; $recoveredSpaces = 0;
if (\strlen($matches[1]) === 2 && \substr($matches[1], 1, 1) === "\t") { if (\strlen($matches[1]) === 2 && \substr($matches[1], 1, 1) === "\t") {
$recoveredSpaces = Line::tabShortage(2, $Context->line()->indentOffset() + $Context->line()->indent()); $recoveredSpaces = Line::tabShortage(0, $indentOffset -1) -1;
} }
$Lines = $this->Lines->appendingTextLines( $Lines = $this->Lines->appendingTextLines(

View File

@ -5,6 +5,15 @@
<blockquote> <blockquote>
<p>quote</p> <p>quote</p>
</blockquote> </blockquote>
<p>indented code in indented blockquote:</p>
<blockquote>
<pre><code>code
</code></pre>
</blockquote>
<p>quote in indented blockquote:</p>
<blockquote>
<p>quote</p>
</blockquote>
<p>no space after <code>&gt;</code>:</p> <p>no space after <code>&gt;</code>:</p>
<blockquote> <blockquote>
<p>quote</p> <p>quote</p>

View File

@ -3,6 +3,12 @@
indented: indented:
> quote > quote
indented code in indented blockquote:
> code
quote in indented blockquote:
> quote
no space after `>`: no space after `>`:
>quote >quote