mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 17:56:02 +03:00
[GH-ISSUE #416] Update MD010/hard-tabs to allow configuring the number of spaces in a code block/fence #2194
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2194
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Stanzilla on GitHub (Aug 3, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/416
My
.markdownlint.jsonconfig is as follows:Yet when I use quick fix to replace a hard-tab, it replaces it with 2 spaces instead of 4.
https://user-images.githubusercontent.com/75278/128001971-55a907c6-66ee-42ee-94eb-518d570763f3.mp4
@DavidAnson commented on GitHub (Aug 3, 2021):
MD010 replaces each hard tab character with a single space because that's how it renders in normal text. Inside code blocks, the number of spaces is still 1 and this is not currently configurable. Is seems you would like to see that ability added to the library?
@Stanzilla commented on GitHub (Aug 3, 2021):
Oh I did not know that, yeah I assumed it would replace a hard-tab with my configured tab width equivalent in spaces.
@DavidAnson commented on GitHub (May 1, 2022):
I think the
spaces_per_tabparameter may already do what you want: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md010@Stanzilla commented on GitHub (May 1, 2022):
Oh interesting, thank you!
@nschonni commented on GitHub (Sep 9, 2022):
I was thinking of opening a new issue, but I think it's still related to this one.
Usually inside a code fence a more sensible default would be 2 or 4 (the GitHub rendering default of 8 is too much). Maybe that requires a separate option than the current
spaces_per_tablikespaces_per_tab_in_code(awkward name) or allowing the currentcode_blocksto use an integer for those spaces instead of the current boolean@DavidAnson commented on GitHub (Sep 9, 2022):
As this is closed, a new issue would be helpful!