mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 09:46:01 +03:00
[GH-ISSUE #310] Shebang support #265
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#265
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 @brandonkal on GitHub (Jul 31, 2020).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/310
The file's shebang line should be stripped before the text is passed to rules.
I found that rules 18 and 41 complain on the line. This should be simple to implement.
@DavidAnson commented on GitHub (Jul 31, 2020):
Can you please show an example? I’m not familiar with shebang in Markdown; the files are not usually executable.
https://en.m.wikipedia.org/wiki/Shebang_(Unix)
@brandonkal commented on GitHub (Jul 31, 2020):
The pattern is not widespread but it enables some exciting use-cases.
@DavidAnson commented on GitHub (Jul 31, 2020):
It’s a slight abuse of the feature, but have you tried defining a front matter regular expression to match the shebang syntax? That should tell the tool to strip that first line out automatically.
@DavidAnson commented on GitHub (Sep 19, 2020):
For this use case, I the suggestion above seems to work fine:
@DavidAnson commented on GitHub (Oct 16, 2020):
Closing issue since this seems to be an uncommon scenario and the approach outlined above works.