Repository navigation
fix: keep tabs in fenced code inside a block quote - #4185
Open
dyk1454683243-sudo wants to merge 1 commit into
Open
dyk1454683243-sudo wants to merge 1 commit into
dyk1454683243-sudo wants to merge 1 commit into
Conversation
The block quote marker consumes one optional space column. Expanding the whole whitespace run after `>` turned a content tab inside a fence into spaces. Leading tabs outside a fence are still expanded so indented code keeps CommonMark example 6. Fixes markedjs#4184 Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
|
@cursoragent is attempting to deploy a commit to the MarkedJS Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Marked version: 18.1.2 and later (current
master)Markdown flavor: CommonMark | GitHub Flavored Markdown
Description
#4110 expanded the whole whitespace run after a block quote's
>into spaces. When a fenced code block sits inside the block quote, a tab in the code is part of that run, so it came out as spaces.stripBlockquoteLinesnow takes only the>marker and its one optional space column. When that column is a tab, the rest of its tab stop is kept as spaces, so CommonMark example 6 (>\t\tfoo) still renders as indented code. Leading tabs outside a fence are still expanded. On lines inside an open fence, tabs stay as they are. The opening and closing fence lines are still expanded, so the space-only fence rules keep matching. Pedantic mode is unchanged.Contributor
test/specs/new/blockquote_fenced_code_tab.md(withrenderExact: true) and unit tests intest/unit/marked.test.jsthat compare exact strings, including the tab byte.npm testpasses: 1985 spec tests, 245 unit tests, plus UMD, CJS, types and lint.Committer
In most cases, this should be a different person than the contributor.