mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
fix: keep a tab after the block quote marker's space literal (#4208)
Co-authored-by: usesprocket[bot] <306702232+usesprocket[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
usesprocket[bot]
parent
1ae2ac9d7f
commit
2d3b47fa21
+3
-2
@@ -234,8 +234,9 @@ export class _Tokenizer<ParserOutput = string, RendererOutput = string> {
|
||||
|
||||
const currentRaw = currentLines.join('\n');
|
||||
const currentText = currentRaw
|
||||
// a tab after the block quote marker runs to the next tab stop, and
|
||||
// the marker only consumes one space of it; the rest is content
|
||||
// a tab right after the block quote marker runs to the next tab stop, and
|
||||
// the marker only consumes one space of it; the rest is content.
|
||||
// After a space the marker consumes it whole, so later tabs stay literal.
|
||||
.replace(
|
||||
this.rules.other.blockquoteMarkerWhitespace,
|
||||
(_, marker: string, whitespace: string) => marker + expandTabs(whitespace, marker.length),
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ export const other = {
|
||||
// has to be recognized here or a lazy `===\t` becomes a heading.
|
||||
blockquoteSetextReplace: /\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,
|
||||
blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
|
||||
blockquoteMarkerWhitespace: /^( {0,3}>)([ \t]+)/gm,
|
||||
blockquoteMarkerWhitespace: /^( {0,3}>)(\t[ \t]*)/gm,
|
||||
listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
|
||||
listIsTask: /^\[[ xX]\][ \t]+\S/,
|
||||
listReplaceTask: /^\[[ xX]\][ \t]+/,
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<blockquote>
|
||||
<pre><code> foo
|
||||
</code></pre>
|
||||
</blockquote>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
renderExact: true
|
||||
---
|
||||
> ```
|
||||
> foo
|
||||
> ```
|
||||
Reference in New Issue
Block a user