mirror of
https://github.com/erusev/parsedown.git
synced 2024-09-20 03:51:29 +02:00
Fix recovered spaces calculation
This commit is contained in:
parent
117912c373
commit
54f2c4eb4c
@ -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(
|
||||||
|
@ -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>></code>:</p>
|
<p>no space after <code>></code>:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>quote</p>
|
<p>quote</p>
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user