mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #634] Reference link double on format #2333
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#2333
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 @MalcolmMielle on GitHub (Nov 11, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/634
On 2 or more save of a file, two list of references are generated. One outside off the begin/end tag and one in. I get really inconsistent results with setting in and out of the workspace but never one where it works.
Steps to Reproduce the Bug or Issue
Expected behavior
You should get
I have tried blocking all rules in
mardownlint.configbut it changed nothing@MalcolmMielle commented on GitHub (Nov 11, 2022):
God I open this and I fix it by realizing I badly named my config file...
in
.markdownlint.jsonsolves this.Sorry for a bad case of didn't read the manual...
@DavidAnson commented on GitHub (Nov 11, 2022):
Glad you got this sorted out! I will have a look anyway, because this behavior is not expected. That rule is trying to remove the two definitions above and below that line and it works fine individually (see playground below). I can't test bulk fix from my phone, but will do so later. However, even with a bug, I don't understand how you would end up with two copies of the reference that isn't being removed.
https://dlaa.me/markdownlint/#%25m%23%20Python%20style%20guide%0A%0AWe%20use%20the%20%5B%5BGuidelines%2FPython-style-guide%5D%5D%20with%20some%20modifications.%0A%0A%5B%2F%2Fbegin%5D%3A%20%23%20%22Autogenerated%20link%20references%20for%20markdown%20compatibility%22%0A%5BGuidelines%2FPython-style-guide%5D%3A%20..%2F..%2FGuidelines%2FPython-style-guide%20%22Python%20language%20rules%22%0A%5B%2F%2Fend%5D%3A%20%23%20%22Autogenerated%20link%20references%22%0A
@MalcolmMielle commented on GitHub (Nov 11, 2022):
I generate the reference links using foam and it might be simply recreating the list after the formating.
@DavidAnson commented on GitHub (Nov 15, 2022):
@MalcolmMielle I assume you are using VS Code. If I create a new Markdown document with the content you show above and run the "Fix all supported markdownlint violations in the document" command, I get the following as expected:
If you want to leave the "//begin" and "//end" comments alone, the following configuration does so:
With that configuration in place, no issues are reported/fixed.
This all seems correct. If you see otherwise, please try running the markdownlint fix command as I am directly - you may have another extension trying to apply fixes on save and interfering.
I'm using the latest VS Code and markdownlint extension v0.48.1.
@MalcolmMielle commented on GitHub (Nov 15, 2022):
I'm using VSCode and the other extension rewritting the list of link is the foam app. Your configuration file is perfect :). Thanks a lot for chekcing it out!